Updated Shoes Tutorial Note
Hi all, Updated Shoes Tutorial Note on GitHub (http://e93f3.zz.tc/1f4j) and on Heroku (http://eif3.zz.tc/si2f4j). Hope you like it, ;-) ashbb
Re: Updated Shoes Tutorial Note
Hi J.David, I am planning to teach my introduction to programming class this fall by starting with Ruby (in text mode) and continuing to Shoes. Wow, pretty good! I'm curious about that. If possible, please let me know the details (post here). Your topics for chapter 4 look like a good start. Thanks. :) That structure is the same as _why's first official guidebook: Nobody Knows Shoes (http://hackety.org/press/) You can see the kind of tutorials that I write for my students Great! They are very helpful to me. Thanks, ashbb On Sun, Jul 19, 2009 at 9:42 AM, J David Eisenberg catc...@catcode.comwrote: On Sun, 19 Jul 2009, Satoshi Asakawa wrote: Hi J. David, Wow, looked at my note? Really helpful comments, thank you so much! Who is the audience for your tutorial? They already know Ruby. Have you considered a navigation system like the one in Daniel Carrera's Ruby tutorial? Cool! Sorry, to be honest, I've never considered about usability, i.e. layout, explanation, etc. xx-P I think it's time to overhaul my note. I'll try. :) I would like to help; I am planning to teach my introduction to programming class this fall by starting with Ruby (in text mode) and continuing to Shoes. Your topics for chapter 4 look like a good start. You can see the kind of tutorials that I write for my students at http://evc-cit.info/cit020 (towards bottom of page) http://evc-cit.info/cit040 (see online notes under assignments) http://langintro.com/kintro/ (an introduction to the Korean alphabet) Thanks again, ashbb -- J. David Eisenberg http://catcode.com/
Re: Updated Shoes Tutorial Note
Hi Ehsanul, Thank you for the encouragement. :) I'm really glad, if it gave you some help. Shoes programming is fun! Thanks, ashbb On Sun, Jul 19, 2009 at 12:38 PM, Ehsanul Hoque ehsanul...@hotmail.comwrote: Really nice, helped me with stuff that wasn't in the manual, or perhaps what I didn't notice. Cool, keep up the great work :) -- Subject: Updated Shoes Tutorial Note From: ash...@gmail.com To: shoes@code.whytheluckystiff.net Date: Sat, 18 Jul 2009 15:08:51 +0900 Hi all, Updated Shoes Tutorial Note on GitHub (http://e93f3.zz.tc/1f4j) and on Heroku (http://eif3.zz.tc/si2f4j). Hope you like it, ;-) ashbb -- Bing™ brings you maps, menus, and reviews organized in one place. Try it now.http://www.bing.com/search?q=restaurantsform=MLOGENpubl=WLHMTAGcrea=TXT_MLOGEN_Local_Local_Restaurants_1x1
Re: Dynamically changing the size/title of the shoes main window
Hi Ehsanul, I know this is not your request. But it may be seen like the same behavior. ;-) Shoes.app :width = 200, :height = 200, :title = 'Hi' do timer 5 do Shoes.app :width = 300, :height = 300, :title = 'Hello' app.close end end Regards, ashbb On Wed, Jul 15, 2009 at 9:30 PM, Ehsanul Hoque ehsanul...@hotmail.comwrote: Somebody was confused about setting the size of a window, but I thought it was about dynamically changing it, which is something I've wanted to do
Re: Is my function not working, or is it shoes?
Hi Timothy and Cecil, That is a known problem. Look at the below post and lots of discussions. - Edit_line and keypress http://www.mail-archive.com/shoes@code.whytheluckystiff.net/msg03769.html If you want to use enter-key, this might also be useful. - Gallery 2-1 http://shoes-tutorial-note.heroku.com/html/01110_Fancy_Gallery_1-5.html Regards, Satoshi On Sun, Jul 12, 2009 at 2:25 PM, Cecil Coupe cco...@cableone.net wrote: Hi, This may not help, but what I've done is something like this to enter a string @el = edit_line @outMB, :width = 40 do @outMB = @el.text # call your function here end Attach the block to the edit_line and don't worry about keypress (unless you really need key by key actions) On Sat, 2009-07-11 at 22:23 -0600, Timothy McDowell wrote: ef roll die a = nil if (a = die.match(/([0-9]+)d([0-9]+)/)) answer = 0 a[1].to_i.times do answer += rand(a[2].to_i) + 1 end return answer else para Not a valid die type. end end Shoes.app do @text = para Type a die roll into the box, and then hit enter. Ie: 2d6 flow do @editline = edit_line end keypress do |k| case k when :enter a = roll @editline.text para a.to_s @text.replace a end end end There is my code. I know my 'roll' method works fine. When I hit 'enter' when the editline has focus, nothing happens... any help? -- --Brains.
Re: Serious Weirdness
Hi Devyn and Chris, Yeah, I also confirmed on my Windows XP with Shoes 2 (0.r1134). I attempted to edit a bit like the below snippet. I guess you may be able to get the same behavior without disappearing. ;-) Shoes.app :width = 400, :height = 300 do @x, @y = 0, -100 @shape = shape :fill = '#333', :stroke = '#aaa', :left = @x, :top = @y do move_to 0,0 line_to 300,0 line_to 0,100 line_to 0,0 end animate 30 do @shape.move(@x+=3,@y+=5) end end Cheers, ashbb On Wed, Jul 8, 2009 at 2:40 AM, Christopher Small metasoar...@gmail.comwrote: That is weird - I confirm. Chris On Tue, Jul 7, 2009 at 10:30 AM, Devyn Cairns devyn.cai...@gmail.comwrote: Shoes.app :width = 400, :height = 300 do @x, @y = 0, 0 @shape = shape :fill = '#333', :stroke = '#aaa' do move_to 0,0 line_to 300,-100 line_to 0,-100 line_to 0,0 end animate 30 do @shape.move(@x+=3,@y+=5) end end As you can (may) see, as soon as the shape touches the bottom it disappears.
Re: issues with ask_save_file and ask_open_file on Leopard
Hi Christopher and Cecil, I ran the following and got `String` on the Shoes console window. It worked well. I'm using Windows XP and Shoes 2 (0.r1134). Shoes.app do fn = ask_save_file debug fn.class end Just confirmed, though... ashbb On Tue, Jun 30, 2009 at 7:44 PM, Cecil Coupe cco...@cableone.net wrote: I vaguely remember a huh? like you report. I don't have OS X anymore so I can't test. On Linux I use a construct like button Save As... do fn = ask_save_file if fn and fn.length 0 #puts Setting new file #{fn} $secFile.fn = fn $secFile.save end end I wouldn't use that fn.length check unless it hadn't bit me. Opening files with no name? None of that probably helps you. On Tue, 2009-06-30 at 01:03 -0700, Christopher Small wrote: Actually, I was wrong earlier - the ask_open_file seems to be working properly, it's just the ask_save file that is not working. Shoes.app do fn = ask_save_file debug fn.class end Running this and entering in test.txt for the filename sends NilClass to the console. ?? - What the heck? Am I really the only person somehow having this issue? Any ideas? Chris On Sun, Jun 28, 2009 at 11:09 AM, Christopher Small metasoar...@gmail.com wrote: Hi there. Running Leopard and having trouble with the ask_save_file and ask_open_file. The windows pop up and everything, but trying to capture the output is not working correctly. If I do fn = ask_open_file text = open( fn ) fn gets set to nil and the open method does not work properly. Has anyone else had this problem? Chris
Re: dynamically changing teh width nad height of a slot
Hi Dave, I'm not sure if I understand you correctly, though... Shoes.app do stack :left = 10, :top = 10, :width = 0.8, :height = 0.8 do background blue end end Hope it helps, ashbb On Mon, Jun 22, 2009 at 6:29 PM, dave dave.lil...@clear.net.nz wrote: Question, you have a shoes window setup to by X long and Y wide how do you go about having a slot to move with the window as it's made wider/height or narrower and shorter? I thought of the repaint but haven't found anything on google that would explain how to use or do it. any pointers or code snippets? thanks dave.
Re: Animated Gif
Hi Phillip, I think it's not available so far. But it's possible like this. Of course if you like, though. ;-) Look at Gallery No.5: http://github.com/ashbb/shoes_tutorial_html/blob/master/mdowns/01110_Fancy_Gallery_1-5.mdown Regards, Satoshi On Sat, Jun 13, 2009 at 4:43 AM, Phillip Neumann pneum...@gmail.com wrote: Hi! [Im new to Shoes] How do you guys make animated .gif's move in shoes? Is it possible to .play .pause or something similar? Thanks!
Re: sqlite3 and shoes
Hi Dave, where can one go for a searchable index of this forums messages? http://www.mail-archive.com/shoes@code.whytheluckystiff.net/ Hope it helps. :) ashbb On Sun, Jun 7, 2009 at 7:51 PM, dave dave.lil...@clear.net.nz wrote: Hi folks, been to this site http://sqlite-ruby.rubyforge.org/sqlite3/faq.html and printed off the hints there. but looking for more... and coming up empty. I like to be able to get the DB and shoes frontend talking and playing nice within two weeks (no data validation as I want a prototype 1st). can someone point me to some other sites (that are ruby not RoR centric)? search google on various searches like ruby with sqlite3 but mostly it's all RoR. also any pointer on bindings (if no one can point me to a website)? like to know more clearly how to inject (if that the word) a string dynamically into a SQL select satement e.g. from the FAQ (think the call it placeholders in an sql statement. Have had some exposure to RDBMS's in the past but that was some time ago and ruby /shoes are still newish to me. what i like to be able to do is something like the #{rubyvar} within a puts statement where value within rubyvar is displayed but have this inside a select statement. Oh can you do this? stmt = select * from A_table where table_column = + rubyvar db.prepare(stmt) how much harder would active records be to the DBI interface to get up and running with? and any web sites that I could go to for code samples etc relating to sqlite3? also lastly and this is off topic - sorry but where can one go for a searchable index of this forums messages? rgds, dave.
Re: sqlite3 and shoes
Hi Dave et all, _why already answered: Shoes comes with sqlite3/ruby. Yes, it's really cool! Try the following snippet. :) require 'sqlite3' Shoes.app do db = SQLite3::Database.new( test.db ) db.execute( create table t1 (t1key INTEGER PRIMARY KEY,data TEXT,num double,timeEnter DATE) ) db.execute( insert into t1 (data,num) values ('This is sample data',3) ) db.execute( insert into t1 (data,num) values ('More sample data',6) ) db.execute( insert into t1 (data,num) values ('And a little more',9) ) rows = db.execute( select * from t1 ) rows.each{|k, d, n| para #{k} : #{d} : #{n}\n} end References: http://sqlite-ruby.rubyforge.org/sqlite3/faq.html http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html Hope it helps, Satoshi On Sun, Jun 7, 2009 at 11:21 PM, _why w...@whytheluckystiff.net wrote: On Sun, Jun 07, 2009 at 10:51:32PM +1200, dave wrote: also any pointer on bindings (if no one can point me to a website)? Shoes comes with sqlite3/ruby. It is used for the image cache and some small settings. http://sqlite-ruby.rubyforge.org/sqlite3/ _why
Re: Help with our app?
Hi Sarah, Great work! B-) Uploaded your great work to railsbridge/teachingkids. Look at `A little game (Which is correct?)` http://github.com/railsbridge/teachingkids/tree/master Congrats! :-D ashbb On Sun, May 31, 2009 at 5:16 PM, Sarah Allen sa...@ultrasaurus.com wrote: Many thanks to everyone for responding to my urgent cry for help last Thursday. I held my third and final class in the series on Friday and it went well. I've written up my report on my blog: http://www.ultrasaurus.com/sarahblog/2009/05/teaching-kids-to-code-lesson-3/ It's almost the end of school for the year. I'm working with the school to establish a programming class as part of the tech curriculum for future years, since this little pilot program was such a success. Great work everyone! Sarah On May 28, 2009, at 8:38 PM, Edward Heil wrote: Sarah, hi! Great stuff! I have some more answers for you which I'll give you in the context of a reply to Joel, expanding on what he says, and correcting some things where I think he might have misunderstood what the students were trying for -- So, replying to Joel -- On May 28, 2009, at 10:09 PM, Joel Fernandes wrote: 1. couldn't find 'url' in the shoes manual, probably what you're looking for is 'link' Actually, they probably do mean url -- as in a multiple-page app like this little demo: class TwoPages Shoes url '/', :mainpage url '/other', :otherpage def mainpage para this is the main page... para link(this way to the other, :click = '/other') end def otherpage para this is the other page... para link(this way to the main page, :click = '/') end end Shoes.app This stuff is in the Nobody Knows Shoes book, p. 43. Shoes urls only work when you subclass Shoes, as I did here: class TwoPages Shoes then you can define different pages with urls and symbols and methods named after those symbols. When you just put stuff inside the Shoes.app block, you don't need to (and can't) use urls and different pages defined that way. So... to make this work they'd have to use a subclass of shoes, like this: class OurApp Shoes url '/', :index [...stuff...] end Shoes.app # you always need this line, to make stuff happen Next step -- get rid of the index line -- the index method gets called automagically because it is assigned to the url / in the url line. Third step -- as you said, the assignments of click handlers are taking place in a different context than the index method; they don't work together right at all that way. I don't know how I'd explain exactly how that works to the students, honestly, cause I'm a little fuzzy myself, but here's how I'd sum it up in a very simple rule: When you're doing the thing with the pages and URLs, you've got to put EVERYTHING for a page inside the method for that page (def index...end). EVERYTHING. Nothing goes outside those methods, cause those methods build all the pages of the app (in this case, the one page of the app, index. So all those click handlers go inside the def indexend. Final thing -- click handlers on buttons have to be actual code, not a Shoes URL, so this line won't work: button Go Back, :click = / You can fix it two ways. You can make it a link: para link(Go Back, :click = '/') Or you can use the visit method to visit the URL, in a block of code attached to the button: button Go Back do visit / end So a full working app with those changes -- subclass Shoes, get rid of the call to index(), move the click handler assignments into def index...end and fix the button so it visits the Shoes URL right -- would look like this -- and with those four small changes, it works great! ==cut here=== class OurApp Shoes url '/', :index def index clear para Which is correct? stack { @correct = button A bed of clams @wrong1 =button A coalition of cheetahs @wrong2 =button A gulp of swallows } @correct.click { clear para Correct image http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Balloons-aj.svg/550px-Balloons-aj.svg.png button Go Back do visit / end } @wrong1.click { clear para Wrong! image http://icanhascheezburger.files.wordpress.com/2007/05/cheez_doing_it_wrong.jpg } @wrong2.click { clear para Wrong, your consolation prize is... image http://farm2.static.flickr.com/1166/1230713908_083d7f6c53_o.jpg;, :width = 500 } end # this is the end of the index method, which lays out the / page end # this is the end of the subclass, which contains all the pages (well, one page) Shoes.app ==cut here=== http://www.ultrasaurus.com
Re: Shoes reports 0,0 location on newly created image
Hi Devyn, Thanks for the reply. :) Does the following snippet work well on your pc/mac? Shoes.app do o = oval :top = 50%, :left = 50% start do para oval is at (#{o.top}, #{o.left}) end end -- ashbb On Sat, May 23, 2009 at 2:10 PM, Devyn Cairns devyn.cai...@gmail.comwrote: Oh, well read the manual: Shoes thinks of percentages in decimals from 0.0 to 1.0 (0% to 100%). 50% = 0.5 in Shoes. On Fri, May 22, 2009 at 10:10 AM, Satoshi Asakawa ash...@gmail.com wrote: Hi _why, Thank you for the explanation. I understood to need `start` block! But still a bit confusing for the following behavior. :( Shoes.app do o = oval :top = 50%, :left = 50% start do para oval is at (#{o.top}, #{o.left}) end end Run the above snippet, it didn't work and I got the error on Shoes console window: Error in C:/Program Files/Common Files/Shoes/0.r1134/lib/shoes.rb line 394 : can't convert String into Integer Then replaced 50% to 0.5. It works but displayed `oval is at(0, 0)`. Then again replaced 50% to 100. It works and displayed `oval is at(100, 100)`. Umm... I'm using Windows XP and Shoes 2 (0.r1134). Regards, ashbb On Sat, May 23, 2009 at 12:50 AM, _why w...@whytheluckystiff.net wrote: On Fri, May 22, 2009 at 12:04:35PM +, Ehsanul Hoque wrote: Ahh, well I did expect it to work like that, hmmm... It still could be justified I suppose, it's really upto _why whether it's a bug, or just a feature, just how it works. Until the image is drawn, you can't really know `top` and `left`. For instance, let's say you're using percentages: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 para Oval is at (#{oval.top}, #{oval.left}) end Until we compute the window size, the coordinates can't be shown. So, what you do is get the coordinates in the `start` block: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 start do para Oval is at (#{oval.top}, #{oval.left}) end end Because the start block runs after the first paint. It still feels like a bug, but I'm not sure if I want to recompute every slot each time a new element is added. I will probably have `top` and `left` and `width` and so on return exceptions if you try to use them before the window is painted... I don't know. _why -- ~devyn
Re: Shoes reports 0,0 location on newly created image
Hi Devyn, Thank you for the confirmation. That's the same as on my Windows XP. Strange... But still, start does not work for the dynamic creation of objects. Yes, also the same. :( And I attempted the following snippet using 50%. It works except dynamic creation. I need to resize or reappear window for displaying the message. Shoes.app do s = flow :top = 50%, :left = 50% start do para Stack is at (#{s.top}, #{s.left}) end end Umm... ashbb On Sun, May 24, 2009 at 7:26 AM, Devyn Cairns devyn.cai...@gmail.comwrote: But if you change 0.5 to 10, it works, strangely enough. But still, start does not work for the dynamic creation of objects. On Sat, May 23, 2009 at 3:24 PM, Devyn Cairns devyn.cai...@gmail.com wrote: First of all, you have to change the 50% to 0.50. Otherwise it doesn't work. After that, it still reports 0,0. On Linux GTK. On Fri, May 22, 2009 at 11:06 PM, Satoshi Asakawa ash...@gmail.com wrote: Hi Devyn, Thanks for the reply. :) Does the following snippet work well on your pc/mac? Shoes.app do o = oval :top = 50%, :left = 50% start do para oval is at (#{o.top}, #{o.left}) end end -- ashbb On Sat, May 23, 2009 at 2:10 PM, Devyn Cairns devyn.cai...@gmail.com wrote: Oh, well read the manual: Shoes thinks of percentages in decimals from 0.0 to 1.0 (0% to 100%). 50% = 0.5 in Shoes. On Fri, May 22, 2009 at 10:10 AM, Satoshi Asakawa ash...@gmail.com wrote: Hi _why, Thank you for the explanation. I understood to need `start` block! But still a bit confusing for the following behavior. :( Shoes.app do o = oval :top = 50%, :left = 50% start do para oval is at (#{o.top}, #{o.left}) end end Run the above snippet, it didn't work and I got the error on Shoes console window: Error in C:/Program Files/Common Files/Shoes/0.r1134/lib/shoes.rb line 394 : can't convert String into Integer Then replaced 50% to 0.5. It works but displayed `oval is at(0, 0)`. Then again replaced 50% to 100. It works and displayed `oval is at(100, 100)`. Umm... I'm using Windows XP and Shoes 2 (0.r1134). Regards, ashbb On Sat, May 23, 2009 at 12:50 AM, _why w...@whytheluckystiff.net wrote: On Fri, May 22, 2009 at 12:04:35PM +, Ehsanul Hoque wrote: Ahh, well I did expect it to work like that, hmmm... It still could be justified I suppose, it's really upto _why whether it's a bug, or just a feature, just how it works. Until the image is drawn, you can't really know `top` and `left`. For instance, let's say you're using percentages: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 para Oval is at (#{oval.top}, #{oval.left}) end Until we compute the window size, the coordinates can't be shown. So, what you do is get the coordinates in the `start` block: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 start do para Oval is at (#{oval.top}, #{oval.left}) end end Because the start block runs after the first paint. It still feels like a bug, but I'm not sure if I want to recompute every slot each time a new element is added. I will probably have `top` and `left` and `width` and so on return exceptions if you try to use them before the window is painted... I don't know. _why -- ~devyn -- ~devyn -- ~devyn
Re: Shoes reports 0,0 location on newly created image
Hi _why, Thank you for the explanation. I understood to need `start` block! But still a bit confusing for the following behavior. :( Shoes.app do o = oval :top = 50%, :left = 50% start do para oval is at (#{o.top}, #{o.left}) end end Run the above snippet, it didn't work and I got the error on Shoes console window: Error in C:/Program Files/Common Files/Shoes/0.r1134/lib/shoes.rb line 394 : can't convert String into Integer Then replaced 50% to 0.5. It works but displayed `oval is at(0, 0)`. Then again replaced 50% to 100. It works and displayed `oval is at(100, 100)`. Umm... I'm using Windows XP and Shoes 2 (0.r1134). Regards, ashbb On Sat, May 23, 2009 at 12:50 AM, _why w...@whytheluckystiff.net wrote: On Fri, May 22, 2009 at 12:04:35PM +, Ehsanul Hoque wrote: Ahh, well I did expect it to work like that, hmmm... It still could be justified I suppose, it's really upto _why whether it's a bug, or just a feature, just how it works. Until the image is drawn, you can't really know `top` and `left`. For instance, let's say you're using percentages: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 para Oval is at (#{oval.top}, #{oval.left}) end Until we compute the window size, the coordinates can't be shown. So, what you do is get the coordinates in the `start` block: Shoes.app do o = oval :top = 50%, :left = 50%, :radius = 20 start do para Oval is at (#{oval.top}, #{oval.left}) end end Because the start block runs after the first paint. It still feels like a bug, but I'm not sure if I want to recompute every slot each time a new element is added. I will probably have `top` and `left` and `width` and so on return exceptions if you try to use them before the window is painted... I don't know. _why
Re: report on Shoes class #2
Hi Sarah and folks, I'm using SciTE on Windows XP and Shoes 2 (0.r1134). - Create the following two files. - Open shoes_launcher.rb with SciTE. - Push `F5` key. - Will launch shoes_app.rb `#! shoes` is important at the first line in shoes_app.rb. # shoes_launcher.rb %x(ruby shoes_app.rb) #! shoes # shoes_app.rb Shoes.app do para 'Hi, all!' end I think this tip can work with any other editors. But, I have no other editors, no Unix and Mac... Hope it helps, ashbb ps. Shoes class #2 Congrats! :-D I think I'll change it next week to add some interactivity So cool! If you need some help about Shoes, feel free let me know. I'd like to help you. :) On Sat, May 23, 2009 at 4:56 AM, Sarah Allen sa...@ultrasaurus.com wrote: Report from the field on my ongoing adventure teaching Ruby and Shoes to a 4th/5th grade class of 28 students. I started with a demonstration of red, green, blue color: 3 flashlights with colored gels over the front, mixing red + green to get yellow + blue to get white. I talked about how last week we made Shoes draw a colored rectangle on the screen. The screen is made up of lots of little dots. Does any one know what they are called? one hand, correct answer: pixels. Then I described how each pixel is a little light, so when we make colors on the computer, we are making colors with light, which is quite different than making colors with paint. Then we turned out all the lights and it got really fun. I asked them first what did they think happened that made a white light come out as a blue light when I put the gel over the front of the flashlight? (lots of theories of magical color transformation and after a few tries, I supplied to correct answer) when you mix red + green paint, what do you get? (several tries before one of them got the right answer: brown) I told them light mixes differently than paint, which we call additive color, as opposed to subtractive color. Then with the help of my two assistent we demostrated color mixing, It was way cool. Fewer setup problems this time. I had 3 extra computers set up and still ended short one and ended up once again abandoning my idea of coding demo since I gave the teacher computer to a pair of students. I ended up writing code snippets on the board and spending more time with each group of 2-3 kids helping debug syntax errors and giving little impromptu explanations of what was going on. I'm torn between how much time to spend explaining concepts (since they are always antsy to get onto the computers) and how much to let them wing it (which then is frustrating to them because they don't know the rules. Many of them seemed to have a hard time with the parameter syntax. Syntax errors that were hard for the kids : width = 40 : width = 40 :width 40 also, I don't understand: Shoes.app do backround black end - does not produce a syntax error, just a blank canvas, why? I also avoided explaining why the top,left of a star and arrow is in the middle -- seems like broken semantics to me. I think there must be an easier workflow than what we've been doing: write app in notepad++, save to desktop, double-click shoes, click open an app -- does anyone have a workflow where you can run Shoes directly from the editor? it would be nice if the shoes window with the errors had a Reload button and keystroke, likewise with the Shoes window. Also, they wondered: why is it called Shoes? At the end of the class I asked them to raise hands to answer: who thought it was fun? (about 2/3s of the class) who thought it was frustrating? (maybe 40%) who thought it was fun even though it was frustrating (about 1/3). I really don't know what impact this has, but I will forge ahead nonetheless. The teacher seems to think the lessons are great and the kids report having more fun than it looks like they are having. I do feel like about half the class is starting to get it. Not sure if that is a lot or very few after 1.5 hours of programming experience. Today I was still following my original lesson plan: http://github.com/railsbridge/teachingkids/blob/de9dc5444e4aa69de656739510353abebf625ff4/md/Ruby_Programming_and_Shoes.md I think I'll change it next week to add some interactivity, unless I veer in a different direction, since my RAD dorkboard arrived and I may switch to making an LED blink! Thanks everyone again for your support. And special thanks to why for making Shoes. Sarah http://www.ultrasaurus.com
Re: Shoes reports 0,0 location on newly created image
Hi Devyn, I'm not sure that is a bug... But you can get the expected values from the following code. Shoes.app do @i = image 24,24, :left = 1, :top = 1 do end para #...@i.style[:left]}, #...@i.style[:top]} end Hope it helps, Satoshi On Tue, May 19, 2009 at 11:43 AM, Devyn Cairns devyn.cai...@gmail.comwrote: Erm... bug? Shoes.app do @i = image 24,24, :left = 1, :top = 1 do end para #...@i.left}, #...@i.top} end #= 0,0 Why? -- ~devyn
Umm... red equal blue???
Hi _why et al, I have a question: 'Umm... red equal blue???' is shown when I run the following snippet. Strange or correct? Shoes.app do stack do para blue is #{blue.inspect} if rgb(0, 0, 255) == blue para red is #{red.inspect} if rgb(255, 0, 0) == red para yellow is #{yellow.inspect} if rgb(255, 255, 0) == yellow para Umm... red equal blue??? if red == blue para Umm... blue equal yellow??? if blue == yellow para Umm... yellow equal red??? if yellow == red end end I'm using Shoes 2 (0.r1134) and Windows XP. Regards, ashbb
Re: teaching shoes to 4th/5th graders, first lesson
Hi _why et al, Would it help if I packaged a version of Shoes which was just in a zip file? Don't we need admin account to install Shoes on Windows? So, cool! I also really want that zip file. Regards, ashbb On Fri, May 15, 2009 at 11:33 PM, Hugh Sasse h...@dmu.ac.uk wrote: On Fri, 15 May 2009, _why wrote: Would it help if I packaged a version of Shoes which was just in a zip file? I think this is a good idea anyway: An install that touches as little of the system (registry, start menus, etc) is a good way to allow the truly paranoid to break the ice, builds a trusting relationship with the Shoes Author slowly, etc. Someone bitten by viruses[1] will be shy about such things (if not .shy). Hugh [1] Mixed biological metaphor error at line 5
Re: +r1229 [BUG] 400+ TextBlocks in a flow causes segmentation fault
Hi Devyn, It works fine on my Windows VISTA with Shoes 2 (0.r1134), too. :) Regards, Satoshi ps. Oh, this problem is only r1229 ? On Sun, May 3, 2009 at 8:15 AM, Krzysztof B. Wicher kwic...@gmail.comwrote: It works fine on OSX and r1229 On Sat, May 2, 2009 at 11:54 PM, Devyn Cairns devyn.cai...@gmail.com wrote: Stumbled on this by accident. Try this and see what you get: Shoes.app do Thread.start do 400.times { para '', :stroke = black } end end -- ~devyn
Re: Double buffering?
Hi Timothy, How does this Gallery No.5 look? http://github.com/ashbb/shoes_tutorial_html/blob/master/mdowns/01110_Fancy_Gallery_1-5.mdown Hope it helps, ashbb On Thu, Apr 30, 2009 at 9:17 AM, Timothy McDowell tmcdow...@gmail.comwrote: Is it possible to use a double buffered setup with Shoes? Ie: Draw on backscreen buffer (not displayed) then 'flip' it out with the currently displayed buffer? I would think it would reduce flicker... -- --Timothy.
Re: width and height methods problem on OSX
Hi Seth, Wow! It works pretty well on my Windows XP, too. I can't confirm on Mac, because I've no Mac. :-P I'll post your cool solution into the Shoes programming course. Thanks so much, ashbb On Fri, Apr 24, 2009 at 1:18 AM, Seth Thomas Rasmussen sethrasmus...@gmail.com wrote: On Thu, Apr 23, 2009 at 11:49 AM, Satoshi Asakawa ash...@gmail.com wrote: Hi all, I got the following information (problem) in my Shoes programming course at the RubyLearning. Try to run and click the button every after resizing the Shoes window: Shoes.app do button 'show' do para #{width} : #{height}\n end end Indeed. Here is a workaround, fwiw: go through the slot object. Shoes.app do other_slot = flow button 'show' do # This should report on the top level flow. para app slot #{slot.width} : #{slot.height} # This should report on the 0 height flow we created. para other slot #{other_slot.width} : #{other_slot.height} end end Seems to work for me on OS X with a recent policeman build. -- Seth Thomas Rasmussen http://greatseth.com
Re: Package Shoes Apps
Hi doki_pen, Run `$ shoes -p` with no files. Shoes window will be lauched. Look at the shoes_package.png at this: http://github.com/ashbb/shoes_tutorial_html/blob/master/mdowns/00503_shoes_--help.mdown Hope it helps, ashbb On Tue, Apr 7, 2009 at 11:50 PM, doki_pen doki_...@doki-pen.org wrote: How do I create a shy file? [10:49:24] rcors...@lemmy ~/src $ shoes -p shoes-war in `require': no such file to load -- binject
Re: Package Shoes Apps
Hi doki_pen, Umm I'm using Windows XP with Shoes 2 (0.r1134). I have no linux box. Sorry. Hope to someone help you... ashbb On Wed, Apr 8, 2009 at 12:59 AM, doki_pen doki_...@doki-pen.org wrote: I get the same result with no args: in `require': no such file to load -- binject Is this library available on linux? Do I need to install something? Was my shoes build broken? Satoshi Asakawa wrote: Hi doki_pen, Run `$ shoes -p` with no files. Shoes window will be lauched. Look at the shoes_package.png at this: http://github.com/ashbb/shoes_tutorial_html/blob/master/mdowns/00503_shoes_--help.mdown Hope it helps, ashbb On Tue, Apr 7, 2009 at 11:50 PM, doki_pen doki_...@doki-pen.org mailto: doki_...@doki-pen.org wrote: How do I create a shy file? [10:49:24] rcors...@lemmy ~/src $ shoes -p shoes-war in `require': no such file to load -- binject
Re: color looking for file???
Hi Louis, I think it's not bug. ;-) fill yellow is correct. fill yellow is not correct. The first `yellow` is a method. It returns the same as rgb(255, 255, 0) For more information: http://help.shoooes.net/Colors.html Hope it helps, ashbb On Fri, Mar 27, 2009 at 11:55 PM, Louis-Philippe defa...@spiralix.orgwrote: Hi, I have the weird bug on Raisin, OSX 10.5.5, PowerPC doing: Shoes.app do stack do position = 0 %w[aqua yellow tan].each do |color| fill color rect(:top = position,:width = 600,:height = 20) position += 20 end end end ## the fill color, doesn't work and gives error: - Shoes could not find file aqua - Shoes could not find file yellow - Shoes could not find file tan the way I find to make it work now is by wrapping the color in an eval function. weird L-P
Re: Weirdest bug
Hi Tieg, Ahhh! I confirmed the same problem on my Windows XP laptop with Shoes 2 (0.r1134). ashbb On Fri, Mar 27, 2009 at 11:26 AM, Tieg Zaharia tieg.zaha...@gmail.comwrote: I found a strange bug in Raisins tonight. When I open Shoes, go to the Manual, go to search and type z as the first letter, Shoes freezes up. None of the other alphanumeric letters do this for me, and I didn't see anything in the search.rb file while skimming it. OS X 10.5.6 and stuff, -tieg
Re: Best way to draw complex styles around text
Hi Alexander and folks, The main slot (app.slot) is flow not stack. If you add `:width = 45` into Seth's sample snippet. It'll work as same as your code. See this: - http://help.shoooes.net/Slots.html You can find the following line: - Last thing: The Shoes window itself is a flow. If you add no styles, the width will be 100%. 100% means the object fills its parent slot. Regards, ashbb On Tue, Mar 17, 2009 at 11:40 PM, Alexander Rakoczy scissorjam...@gmail.com wrote: Firstly, I believe the main slot (app.slot) is a stack. I could be wrong here, though. Secondly, for some reason you have to stop the inner flow from being the full width of the app: Shoes.app do flow do para you have flow :width = 45 do #stop from taking over the world background red..green para GOT, :stroke = white end para to be kidding me end end I'm not sure why, either. On Tue, Mar 17, 2009 at 09:25, Seth Thomas Rasmussen sethrasmus...@gmail.com wrote: On Tue, Mar 17, 2009 at 1:10 AM, Daniel Worthington daniel.worthing...@gmail.com wrote: So, I am a web developer and basically I am trying to style text as if it were an inline block. I'm sure this can be done somehow, but I was wondering what y'all think is the simplest way What I really want to do is have text, say a single word in a paragraph, and give it a border and rounded corners and even a gradient background (or anything else you can do with a background in Shoes) but just on an em, or a code. All I can seem to do is change the :fill on these elements, which is pretty much what you get in HTML, but I am greedy and want to make things beautiful. Backgrounds seem to only work on stacks and flows. Help? Hmm. I was thinking that you might be able to hack it with a lot of flow/para jiggery pokery, but perhaps not.. Shoes.app do para you have flow do background red..green para GOT, :stroke = white end para to be kidding me end Each para in that example is on its own line, despite everything being in flows. I'm not sure why, perhaps somebody else knows more about layout to come up with a solution here.. I think that maybe the new flow produces a newline effect, despite it being rendered inside a flow.. not sure if that's correct behavior or not. -- Seth Thomas Rasmussen http://greatseth.com -- alexander rakoczy http://arakoczy.com
Re: + on our way to shoes 3
Hi _why et al, Will the next shoes ship with bloopsaphone? It would be very nifty if it did. :) Definitely, it's already so in the master branch. _why Cool! And snapshot function, too? ;-) I'm really curious about Shoes 3. Thanks, ashbb
Re: Arts and Codes (and flocking chickens)
Hi Wally, You'll be attending Hackety Hack class of ArtandCode conference? Cool! Really envy you. I've living in Japan, so can't attend this time. :( But really really want to know everything about that. If possible, please post and share videos, photos, blogs, etc. ;-) Hungry Boids with Shoes is fantastic. Curious behavior, never get tired of looking at. :) Thanks for sharing your great work, ashbb On Sat, Mar 7, 2009 at 12:57 PM, Wally Glutton stung...@gmail.com wrote: Yop, Any other Shoe-gazers attending the Art and Codehttp://artandcode.ning.com/conference? I've just arrived in Pittsburgh myself. Tomorrow I'll be attending Info Visualization with Processing (Ben Fry) in the morning, and Playing Games with Hackety Hack (_why) in the afternoon. I'll be wearing an orange shirt and dusty light-brown loafers. Say hi if you see me. :) *Side Note:* If you've been meaning to check out LÖVE http://love2d.org/, you might want to peak at my Hungry Boids http://the-shoebox.org/apps/45ported to Lua as Frock http://github.com/iamwilhelm/frock/tree/master (more infohttp://webjazz.blogspot.com/2009/02/introducing-frock-flocking-chicken.html). Flapping flocking chickens! wg
Re: Array class method unavailable on Shoes?
Hi Leui, I think it's not a bug. Try this one: Shoes.app do class ::Array def open self.inspect end end para [3,3].open end how to access the mailing history See the following: http://www.mail-archive.com/shoes@code.whytheluckystiff.net/ or http://news.gmane.org/gmane.comp.lib.shoes how to change the name of handle name for Yahoo Sorry, I don't use Yahoo mail. Maybe someone will help... :) Hope it helps, ashbb On Mon, Feb 2, 2009 at 12:59 AM, kita yui japan21kita...@yahoo.co.jpwrote: Hi, Array class method seems to be unavailable on the program below. Does anyone know about this? #This code shows only a blank window.. Shoes.app do class Array def open para self.inspect end end [3,3].open end This is a simple question, so it may be on the mailing list already though, I'm not sure how to access the mailing historyLet me know that too. One more question. My handle name for Yahoo comes up (like my_handle_namemy mail addresswrote: ) every time I question to this mailing list. Does anyone know how to change the name of it? Thanks..Leui -- Power up the Internet with Yahoo! Toolbar.http://pr.mail.yahoo.co.jp/toolbar/
Re: More Shoes demo/showcase code [Was: Re: Building a game in Shoes tutorial]
Hi Karel, Awesome! I downloaded your shoes_demonstration_apps from github repo and played all 9 apps. So cool! Especially LOVE sponge letters. :-D I'll use them as the basic instructional textbook in the next Ruby with Shoes programming course, RubyLeaning. Great work! Thanks, Satoshi On Wed, Jan 14, 2009 at 8:48 PM, Karel Minařík karel.mina...@gmail.comwrote: Hello Satoshi, pleasure is mine :) If anybody would be interested, I recently gave a talk on Shoes in local Ruby Users Group, and needed couple of simple examples, covering basic functionality and concepts. So if you would need/have/would like/etc to give some talk on Shoes as well, you can use this as inspiration or whatever: -- http://github.com/karmi/shoes_demonstration_apps/tree/master The final file ( http://github.com/karmi/shoes_demonstration_apps/blob/cb61cafd52be6a72bd334125d3323f066ff9a68e/09_uploader.rb) was my stab at doing rudimentary Uploader app in Shoes. Best, Karel On 12.Jan, 2009, at 3:00 , Satoshi Asakawa wrote: Hi Karel, Thank you for your kindness. We can learn Ruby/Shoes programming with your sheep. :-D http://rubylearning.com/blog/2009/01/12/have-fun-with-ruby-and-shoes/ Best regards, ashbb
Re: Is this a bug?
Hi Constantine, François, I confirmed the same error. But I edited like this: left = 0 - :left = 0 It works fine on my Windows Vista with Shoes 2. ;-) Regards, ashbb On Mon, Jan 12, 2009 at 3:48 AM, François Vaux r...@yapok.org wrote: I've got the very same error here, and the code looks OK, so I assume it's a bug :) I'l test with a manually built shoes to see if the problem is with the .run -- François 2009/1/11 Constantine Cusulos noha...@freemail.gr: Hello all, I tried to run the script from Nobody Knows Shoes p.16: Shoes.app do @o = oval :top = 0, left = 0, :radius = 40 stack :margin = 40 do title Dancing With a Circle subtitle How graceful and round. end motion do |x, y| @o.move width - x, height - y end end The result was that Shoes crashed with the following message: Verifying archive integrity... All good. Uncompressing Shoes test.rb:2: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux] Aborted I am running Shoes 2 (http://shoooes.net/dist/shoes2.run) on Kubuntu 8.10/i386. Is this a bug or a feature? :-) Constantine
Re: Building a game in Shoes tutorial [Was: Re: How do you use shoes elements in external classes, separate files?]
Hi Karel, Thank you for your kindness. We can learn Ruby/Shoes programming with your sheep. :-D http://rubylearning.com/blog/2009/01/12/have-fun-with-ruby-and-shoes/ Best regards, ashbb On Thu, Dec 18, 2008 at 8:19 AM, Karel Minařík karel.mina...@gmail.comwrote: On 17.12.2008, at 17:29, Satoshi Asakawa wrote: Would you mind if I use your cool 'dog hunts sheep' game as the next course exercise? Of course not! Feel free to use whatever you need from the code or the article. On 17.12.2008, at 18:38, François Vaux wrote: However, I'd like to know if you presented that to students, and if yes, how it was received. Quite well, as you can imagine, being it a game :) I was torturing them with abstract explanation of OOP for one lecture (see http://github.com/karmi/sheep_in_your_shoes/tree/master/animals-oriented-on-objects.rb). These are humanities, not computer science students, so they were interested in the concept of OOP and the context, but not so much in the code itself. Of course, when I showed how you can generate 100 sheep easily with a `sheep = []; 1.upto 100; sheep Sheep.new; end`, they become more interested. Games are probably prime example why OOP matters, because you really need smart objects and cannot hack everything with procedural code: cf. armies, villages, etc. in games like Age of Empires. Then one student stated: OK, now I see why the dog is there. So I knew I'm into some Shoes business for sure. In next lecture I brought the game and slowly walked thru the stages, starting from the bundled example, explaining what we're doing and why. They even forced me to export relevant steps from Git repo so they can run different stages of the game on their machines and mess it up a little bit. Seeing the excitement, I began to be quite sure that this could benefit other teachers/students as well, and found a day to polish the codebase and write the article. I think Shoes is very well suited to be the best platform for teaching programming basics. Partly thanks to it's playful nature, but more so because it brings direct, instant satisfaction. Combined with Ruby (which I see as best *language* for teaching programming) it's really a powerful combination. Thanks everybody for the kind words! Best, Karel
Difference between stack and flow
Hi _why et al, I run the following snippet. Shoes.app do flow do 5.times{para test test test\n} end stack do 5.times{para test test test\n} end end The fomer para shows one new line, but the latter para shows three new lines. Umm within the stack, para adds two more new lines automatically?? Regards, ashbb
Re: Events not being reported to the app
Hi Chaim, I attempted to run your code on my Windows XP box. I confirmed the same your problem. Sorry, I don't know why, but looks like a bug... ashbb On Thu, Jan 1, 2009 at 7:10 AM, Chaim Geretz chaim.ger...@idt.net wrote: Greetings, Having fun with shoes, but this is driving me crazy. Any ideas as to why the more_b callback isn't entered once the This always works box has been clicked ? --Chaim Geretz shoes raisins (0.r1134) [i386-mswin32]+video Windows XP Professional Version 2002 Service Pack 2 Shoes.show_log Shoes.app do @flow_a @flow_b @stack_a @stack_b def more_a debug(in more_a) @flow_a.clear if @flow_a @stack_a.append{button} @stack_a.appe...@flow_a = flow {check{more_a}; para This always works}} end def more_b debug(in more_b) @flow_b.clear if @flow_b @stack_b.append{button} @stack_b.appe...@flow_b = flow {check{more_b}; para Won't work after other box was checked}} end @stack_a = stack more_a @stack_b = stack more_b end
Re: Wish for screenshot feature
Hi _why, Jordan et al, Fantastic!! I'm going to announce this great news in the forum of current Shoes course today. :-D Yay, can't wait! Thanks, ashbb On Thu, Dec 18, 2008 at 5:39 AM, _why w...@whytheluckystiff.net wrote: On Thu, Dec 18, 2008 at 02:20:11AM +0900, Satoshi Asakawa wrote: I got a cool idea from the Shoes programming course of RubyLearning.org. It's the screenshot feature like this: Shoes.app do ball = oval 0, 0, 10 animate{|i| ball.move i, i} timer 3 do screenshot './pic_in_3_sec.png' end end We can get the screenshot of Shoes canvas (meaning without window frame) as the png format image data file named pic_in_3_sec.png on the current directory! :-D Believe it or not, this already (partially) exists! It's called the `snapshot` method and was patched in many months ago, but appears to be broken now. (It also doesn't capture native controls or video.) Thus, it has gone undocumented. I've been meaning to fix and get it to give us perfect screenshots. So, yeah, I'm in favor of this feature. _why
Re: MUD client in Shoes issues.
Hi Timothy, I didn't read your code, sorry. But does this help a bit for you? :) http://github.com/ashbb/shoes_tutorial_html/tree/master/mdowns/00530_Open_a_new_app_window.mdown ashbb On Sun, Dec 7, 2008 at 7:00 AM, Timothy McDowell [EMAIL PROTECTED]wrote: http://pastie.org/332844 The above code should work, no? The three windows are open (I know, silly, but I'll explain later), I can type into the one and click the 'snd' button, but nothing ever shows up on the window that is supposed to be written on by the MUD. Any thoughts? Also, that 'window do' bit opens up its own background thread, correct? It runs separately from the other windows? Thanks in advance! -- --Timothy.
Re: ARGV[0] is not set?
_why, Thank you very much. I didn't fully understand the difference between $0/$PROGRAM_NAME and ARGV[0]. It's my fault. I use $0 or $PROGRAM_NAME. Thanks again, Satoshi On Sat, Dec 6, 2008 at 6:55 AM, _why [EMAIL PROTECTED] wrote: On Sat, Dec 06, 2008 at 05:21:15AM +0900, Satoshi Asakawa wrote: I found the following difference. I'm using Windows XP. # test.rb Shoes.app do para file name: #{ARGV[0]} end With Shoes-0.r1091, output is: file name: C:\rubyprograms\shoes\test\test.rb With Shoes-0.r1123, output is: file name: Are you running like this? shoes C:\rubyprograms\shoes\test\test.rb If not, use $0 or $PROGRAM_NAME instead of ARGV[0]. _why
Re: press 'a' then Shoes shows :alt_A a
_why, No problem. I think that it's easy to handle this behavior at app side. Thanks for the reply, Satoshi On Sat, Dec 6, 2008 at 7:02 AM, _why [EMAIL PROTECTED] wrote: On Sat, Dec 06, 2008 at 03:49:48AM +0900, Satoshi Asakawa wrote: I confirmed with Shoes-0.r1123. There is still the same strange behavior... I'm sorry, Satoshi, this will have to wait a bit longer. But next recent build after Raisins I hope will address the Windows keyboard issues raised. _why
Re: Crash on button press when styling stack with :height
Hi Jordan, I confirmed your problem. It happened on my Windows Vista and Windows XP both. I think this behavior is a bug. Because the following snippet works well, no crash. Shoes.app :width = 300, :height = 400 do s = stack do button(press me){alert(You won't see this.)} end s.style :width = 0.5, :height = 1.0 end @_why, have you confirmed this problem? Regards, ashbb On Wed, Dec 3, 2008 at 12:42 AM, Jordan Applewhite [EMAIL PROTECTED] wrote: Strange... I tried it on XP Pro sp2 and Vista (sp1?). I just did it again on my work computer, another XP Pro sp2 machine. What kinds of programs or OS settings would conflict with Shoes? I thought it might be this Autohotkey script I use for KDE-style window dragging, but the error still occurs when that script is turned off. Any other suggestions? I really appreciate your help, Jonty! On Tue, Dec 2, 2008 at 5:44 AM, jonty [EMAIL PROTECTED] wrote: Hi Jordan I've tried your code and it works without a problem, same versions as yourself, win32(xp sp3) r1091 shoes So i'm not sure what your problem is.. which windows have you got? Jordan Applewhite wrote: I just spent an hour struggling with this so I thought I would post here for posterity (and for other newbies like myself). It appears that using :height instead of :scroll_height to style stacks will lead to weird crashes. Or maybe I'm doing something terribly stupid, I don't know. For example, this will crash when the button is pressed: Shoes.app :width = 300, :height = 400 do stack :width = 0.5, :height = 1.0 do button(press me){alert(You won't see this.)} end end but this will not crash when the button is pressed: Shoes.app :width = 300, :height = 400 do stack :width = 0.5, :scroll_height = 1.0 do button(press me){alert(Pressed!)} end end For the record, I was running raisins 0.r1091, mswin32. Bye for now! No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.9.12/1821 - Release Date: 30/11/2008 17:53
Re: A difference between 0.r1091 and 0.r1057
It sounds great! Thank you for the reply, _why. I'm really looking forward to the next release. I guess the final release as raisins. :) Regards, ashbb On Thu, Nov 20, 2008 at 2:55 PM, _why [EMAIL PROTECTED] wrote: On Thu, Nov 20, 2008 at 01:19:26AM +0900, Satoshi Asakawa wrote: The following snippet does the different behavior between with Shoes-0.r1091 and 0.r1057 on my Windows XP. With r1057: red square rotates on the spot With r1091: red square rotates around 0-0 coordinate Ah, good, thank you for finding this. I went a bit overboard with one of my commits related to transformations. I have checked in something that I hope will be better. _why
Re: widgets attributes
Hi Emanuel, I'm not sure that I understand your problem correctly, though... The following code works well as I've expected. I'm useing Windows XP with Shoes-0.r1091. It also works well with Shoes-0.r1057. class Shoes::Widgy Shoes::Widget def initialize opts = {} size = opts[:size] || 50 fill opts[:color] || yellow rect 0, 0, size, size end end Shoes.app :width = 300, :height = 300 do w1 = widgy :left = 50, :top = 50, :color = red w2 = widgy :left = 50, :top = 50, :color = blue, :size = 100 w2.move 100, 100 w3 = widgy w3.left = 200 w3.top = 200 end I think that we can use :left and :top without definition in class Widgy. Because inherited from Shoes::Widget. Hope it helps, ashbb On Wed, Nov 19, 2008 at 10:59 AM, Emanuel Carnevale [EMAIL PROTECTED] wrote: Hi, I know Widgets are not the most cared things in shoes, but I stumbled in this thing: class Shoes::Widgy Shoes::Widget attr_accessor :size def initialize opts = {} @size = opts[:size] || 100 fill #000 rect 0, 0, @size, @size end end I have to call it with w = widgy :top = 20, :left = 30 if I do w.move(30,30) it moves, so I start expecting it behaves like every other elements. but why I cannot do w.left or w.right ? obviously w.size works it's a bug or I'm missing something?
A difference between 0.r1091 and 0.r1057
Hi _why et al, The following snippet does the different behavior between with Shoes-0.r1091 and 0.r1057 on my Windows XP. With r1057: red square rotates on the spot With r1091: red square rotates around 0-0 coordinate Shoes.app do img = image :width = 20, :height = 20, :left = 100, :top = 100 do rect 0, 0, 20, 20, :fill = red end img.click{ img.hide; img.rotate 45; img.show } end A bug or something is missing? Regards, ashbb
Re: links in ur windoze
Hi Josh, Do you really need to open multiple windows? If not, the following code works well. class Bummer Shoes url /, :index url /cleveland, :cleveland url /neverland, :neverland def index para link(go to cleveland, :click = /cleveland) end def cleveland #window :title = cleveland do para link(go to neverland, :click = /neverland) #end #visit / end def neverland para cherries, syrup, puppies end end Shoes.app :title = bummer But if you need to open multiple windows and send some messages between them, the following sample might be of help. http://github.com/ashbb/shoes_tutorial_html/tree/master/mdowns/00530_Open_a_new_app_window.mdown Regards, ashbb On Wed, Nov 12, 2008 at 12:23 AM, Seth Thomas Rasmussen [EMAIL PROTECTED] wrote: On Tue, Nov 11, 2008 at 8:14 AM, Josh Cronemeyer [EMAIL PROTECTED] wrote: So i got this response from brian off-list quoth brian While trying this, I found that I had to kill and re-open shoes to get it t reload the changed .rb file, don't know what's up with that. I dunno either, but I just do it now as a sort of rule. It's easy enough to do that I don't really care that it seems like a bug. class Bummer Shoes url /, :index url /cleveland, :cleveland url /neverland, :neverland def index stack do para link(rather, go to neverland, :click =/neverland) para link(go to cleveland, :click = /cleveland) end end def cleveland window :title = cleveland, :width =200, :height=200 do stack do para link(go to neverland, :click = lambda {$main.visit(/neverland)}) para link(go to crocodile, :click = lambda {clear ; para tick tock}) end end visit / end def neverland para cherries, syrup, puppies end end $main=Shoes.app :title = bummer /quoth brian and hey. that works. woo. I had tried a proc, but not a lambda... I guess that makes some sense because of the app object weirdness. I don't think the difference between proc and lambda is significant here. It's the fact that your actions are only defined for the main app instance. window() creates a context that is basically a new instance of an app. I think you could achieve what you did with your dreaded global variable with Shoes owner() method. -- Seth Thomas Rasmussen http://greatseth.com
Re: Trouble with getting coordinates of shape
Hi Ajithkumar, I confirmed your problem. I run your program on my Windows XP with Shoes-0.r1057. Output was the following on the console window. - Shoes.p @o.left #= 0 - Shoes.p @l.left #= 60 - Shoes.p @m.left #= 0 Then I tried to use style[:left], it worked well. - Shoes.p @o.style[:left] #= 20 - Shoes.p @l.style[:left] #= 60 - Shoes.p @m.style[:left] #= 100 Umm strange... But sorry, I don't know if this is a bug. xx-P Regards, ashbb On Sat, Nov 8, 2008 at 1:05 AM, Ajithkumar Warrier [EMAIL PROTECTED]wrote: Hi, I get the coordinates of a shape only in the second instance of the code below. Is this a bug or something I am missing out on? Thanks Shoes.app :width = 500, :height = 500, :resizable = false do fill rgb(255,0,0) @o = oval 20,20,50,50 Shoes.p @o.left @l = oval @l.style(:top = 20, :left = 60, :width = 50, :height = 50) Shoes.p @l.left flow do @m = oval @m.style(:top = 20, :left = 100, :width = 50, :height = 50 ) Shoes.p @m.left end end
Re: adventures in shoes video
Hi Brian, I tried to run your code on my WindowsXP box with Shoes-0.r1057. I put the mp3 files under the same directory with the code file. You put them under '/' (root) directory? So, my code is the following. It works well. Shoes.app do video test1.mp3, :autoplay = true v = video test2.mp3 timer(5){v.play} end 1st: You need to add :autoplay = true option. See Shoes manual. http://help.shoooes.net/Styles.html 2nd: With my Windows pc, the two mp3 musics are played overlapping... Hope it helps, ashbb On Sat, Nov 8, 2008 at 7:38 AM, Brian Palmer [EMAIL PROTECTED] wrote: Hi fellow adventurers, I'm running into issues with the Video element, and I don't know how much of it is me misunderstanding the documentation and how much of it is buggy shoes. I'm on Leopard 10.5.5 Intel running shoes r1057 (I downloaded, not compiled). First, this never plays my mp3: Shoes.app do @v = video /test1.mp3 @v.play end However, this does: Shoes.app do @v = video /test1.mp3 timer(0.01) { @v.play } end Does the event loop need to process before a new Video element can be played? I saw nothing in the docs. Also, is there no way to play more than one video/audio file at the same time? Nothing in to docs says you can, but nothing says you cannot, either. In any case, this never plays my second file: Shoes.app do @v = video /test1.mp3 timer(1) { @v.play } @v2 = video /test2.mp3 timer(2) { @v2.play } end In my quest to learn shoes I planned to create a small shoes game with moody music and sound effects, but I'm stumbling here. Marginally related, is there a bug tracker for shoes? I can't find any mention of one, or I would've just posted this there. Thanks all. -- Brian
Re: RubyLearning.org Shoes Programming Course
Hi Rick, Thank you for your participation in the Shoes course. Glad to see you there. :) why aren't u in the teachers list. Oh, you have good eyes. Don't worry Satish and I are also attend this course. Let's enjoy Ruby and Shoes programming and please help Sneakers (Shoes newbies). ;-) ashbb On Mon, Nov 3, 2008 at 3:18 AM, paresh mathur [EMAIL PROTECTED]wrote: I am in there seems like a good enough course strange ashbb why aren't u in the teachers list. I thought u designed the course?? On Sat, Nov 1, 2008 at 9:33 AM, Satoshi Asakawa [EMAIL PROTECTED] wrote: Hi all, Satish announced his new online programming course: POIRPWSC101-1I of RubyLearning.org. http://rubylearning.org/class/ Yes, it's the Ruby and Shoes Programming Course! Yay! Let's enroll and enjoy Ruby and Shoes programming with the participants all over the world. :-D For more information, please access the following url. We are really looking forward to see you in the course. :-D http://rubylearning.com/blog/2008/10/31/ruby-and-shoes-programming-a-new-course/ Thanks, ashbb -- bI believe in beautiful ideas, Most of my ideas are of girls./b
Re: Workin' With Widgets
Hi Josh, Same problem? http://www.mail-archive.com/shoes@code.whytheluckystiff.net/msg02194.html Hope it helps, ashbb # Umm... many people in the same trouble... On Mon, Nov 3, 2008 at 2:41 PM, Josh Cronemeyer [EMAIL PROTECTED]wrote: I'm trying to run the simple-menu.rb sample code. It is failing with wrong argument type Shoes::Color (expected Class). I remove the color parameter entirely from the app and then it complains about getting a Hash when it expected a Class. I'm not really sure what is going on, even the widgets from http://hackety.org/2008/06/12/martinDemellosGooeyChallenge.html don't seem to work for me. They fail with very similar error messages :( OSX 10.5 Shoes Rasins r1057
Re: sharing code among multiple windows
Hi Josh, Seth et al, I've tried the other solution. :-D class Examplish Shoes url /, :index url /new, :new_window def index header self para link make a new window, :click = /new end def new_window window :title = 'child' do owner.header self para a new window end end def header win win.para header : #{win}\n end end Shoes.app :title = 'parent' On Sun, Nov 2, 2008 at 3:32 PM, Seth Thomas Rasmussen [EMAIL PROTECTED] wrote: On Sun, Nov 2, 2008 at 1:59 AM, Josh Cronemeyer [EMAIL PROTECTED] wrote: Basic usage question follows: #!/usr/bin/env open -a Shoes.app class Examplish Shoes url /, :index url /new, :new_window def index header para link make a new window, :click = /new end def new_window window do header para a new window end end def header para header end end Shoes.app In the above code the header method is not available inside of the window block. Is there a good way to make a method from the parent window available on the child? I dunno if it's good, but this seems to work: #!/usr/bin/env open -a Shoes.app class ::Shoes def header para header end end class Examplish Shoes url /, :index url /new, :new_window def index header para link make a new window, :click = /new end def new_window window do header para a new window end end end Shoes.app ### It seems that window() creates a new instance of a Shoes app or something which somehow has no understanding of the app which spawned it. Note that if you say class Shoes without the leading :: the app somehow ends up not knowing what url means. At least that's what I found just now with shoes raisins (0.r1064) [i686-darwin8.9.1]. The unusual context within which the main file is executed seems to continually be a problem. It would be nice for it to behave like a normal person. -- Seth Thomas Rasmussen http://greatseth.com
Re: Menus not working with r1057
Hi Laurent and Abdullah, See the following URL. Same problem? http://www.mail-archive.com/shoes@code.whytheluckystiff.net/msg02194.html Hope it helps, ashbb On Mon, Nov 3, 2008 at 7:19 AM, Abdullah Mancy [EMAIL PROTECTED]wrote: me too, blank window on WinXP On Sun, Nov 2, 2008 at 11:54 PM, Laurent Julliard [EMAIL PROTECTED] wrote: I have just installed r1057 on my Linux Ubuntu 8.04 laptop and I have gone through all the samples. It occurs that the menu sample doesn't work (blank window opening). Is this a Linux only problem ? Is the problem known ? Thanks for your help Laurent
RubyLearning.org Shoes Programming Course
Hi all, Satish announced his new online programming course: POIRPWSC101-1I of RubyLearning.org. http://rubylearning.org/class/ Yes, it's the Ruby and Shoes Programming Course! Yay! Let's enroll and enjoy Ruby and Shoes programming with the participants all over the world. :-D For more information, please access the following url. We are really looking forward to see you in the course. :-D http://rubylearning.com/blog/2008/10/31/ruby-and-shoes-programming-a-new-course/ Thanks, ashbb
Re: confirm options
Hi Louis, I see... Thanks for the good explanation and sample code. the user answer before he gets to the main. Umm... Okay, let me try one more time. ;-) Is it necessary to open two windows at once? If not, how about the following? class Sample Shoes $a = 'nothing' url '/', :index url '/main', :main def index para What would you like? button('yes'){$a = YES; clear; main} button('no'){$a = NO; clear; main} end def main button(what?) {alert(You choosed #{$a})} end end Shoes.app :width = 200, :height = 120 Hope I've not misunderstood, :-P ashbb On Sun, Nov 2, 2008 at 1:55 AM, Louis-Philippe [EMAIL PROTECTED] wrote: Hi ashbb, this is cool but but doesn't really get me to what I am trying to do... what I am trying to do to automatically present my user with a yes/no setup question popping up over the the main application window at startup. All the logic is already designed and working. I just need to make sure the popup appear over the main window so that the user answer before he gets to the main. confirm() seemed perfect because it ALWAYS gets on top, its only my question would really need to be twisted for it to make sense with ok/cancel choice, not very elegant. Since confirm() is nor an option, I am trying to have it working with dialog(), but its kinda random if the dialog() window appears over the main window, and I didn't find any info about window ordering in the documentation. a sample of code which illustrate this would be: Shoes.app do $a = 'nothing' stack do para MUST BE UNDER - THIS IS MAIN WINDOW button(what?) { alert(You choosed #{$a})} end dialog do stack do para MUST BE OVER - THIS IS DIALOG WINDOW para What would you like? button('YES') do $a = YES close() end button('NO') do $a = NO close() end end end end 2008/10/31 Satoshi Asakawa [EMAIL PROTECTED] Hi Louis, We don't have any option of confirm method now. But how about the following code? Is this what you want to do? Shoes.app do def button_with_confirm txt = confirm('ok or cancel?') ? 'OK' : 'cancel' @b.remove @b = append{ button(txt){button_with_confirm}} end @b = button 'confirm' do button_with_confirm end end I might have misunderstood, though... :-P Hope it helps, ashbb On Sat, Nov 1, 2008 at 1:07 AM, Louis-Philippe [EMAIL PROTECTED]wrote: oh, and do you know if there is a way to order the appearance of app windows, I liked the confirm() because it always come on top... in my tests windows ordering was unpredictable. L-P 2008/10/31 Louis-Philippe [EMAIL PROTECTED] thanks François, I'll craft something from a dialog() then. L-P 2008/10/31 François Vaux [EMAIL PROTECTED] 2008/10/31 Louis-Philippe [EMAIL PROTECTED]: Hi all, First post on this list :D Hi, and welcome ! :-) I have been playing with Shoes a bit, now using it to build a frontend for a small backup script I have a very small question to start with: Is there any option to change the text on the OK and Cancel button inside of a confirm() dialog? I think there's no way to do that as of now, maybe _why is planning on adding it in the future
Wish colorful edit_box
_why et al, I got a quesion (wish) from the RubyLearning.org participant. - Is it possible to fill the color into the edit_box? I imagin the following. But I can't see the green box. :( ex. edit_box :fill = green Regards, ashbb
Re: Widgets broken, or just me?
Hi Jason, Thank you for the information. See this archive, http://www.mail-archive.com/shoes@code.whytheluckystiff.net/msg02195.html and Shoes manual: The Main App and Its Requires http://help.shoooes.net/Rules.html Hope it helps, ashbb On Sun, Oct 19, 2008 at 2:02 PM, Jason Porter [EMAIL PROTECTED]wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just started on the list, and just getting started with Shoes, I'm thinking of doing a fairly major app (I mean something more involved than games) with Shoes so I started looking through the examples and trying to run them. It seemed like simple-menu isn't working (and a couple others, but I don't remember which atm). Attached is a screenshot of what I'm seeing. I'm using the latest (as of yesterday) build. - --Jason Porter Real Programmers think better when playing Adventure or Rogue. PGP key id: 926CCFF5 PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5 PGP key available at: keyserver.net, pgp.mit.edu -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (Darwin) Comment: http://getfiregpg.org iEYEARECAAYFAkj6v28ACgkQEEbDm5Jsz/XktACffX1VaEUiVRFWtBcXC4qDIFcc jA4AoLjiAD2JyfGDP+ZTEIFJUZd6w5P/ =Abx6 -END PGP SIGNATURE-
Re: Possible Listbox Bug Report
_why et all, I updated my Windows XP box to Shoes-0.r1057 but still have the problem: http://www.mail-archive.com/shoes@code.whytheluckystiff.net/msg01853.html @Dean, The same problem? Regards, Satoshi On Fri, Oct 17, 2008 at 4:03 PM, peter retief [EMAIL PROTECTED] wrote: code? 2008/10/16 Dean Mehinovic [EMAIL PROTECTED]: Not 100% positive, but this is what I have. Tried a simple list_box on windows 2000 professional (3 different machines at work, SP4, one 970 Shoes installation, other two installed from shoes-0.r1057.exe), and the listbox shows up but it cannot drop down when clicked on no matter how many items it has. Tried the same listbox on windows xp and it worked fine. Maybe someone can corroborate or refute this. Thanks, Dean.
Re: Bug in shape click event
Hi Zulfiqar, I confirmed the same problem on my Windows XP and Shoes-0.r1057. @square2 works as expected and @square1 doesn't. # Maybe you made a typo in the first mail, I guess. ;-) Just information. Thanks, ashbb On Thu, Oct 16, 2008 at 4:31 AM, Zulfiqar Ali [EMAIL PROTECTED] wrote: Hi, Think I found a bug with onclick events on shapes. If i use the :center attribute on the shape only the lower right region of the shape is clickable. Shoes.app :width = 350, :height = 200 do @square1 = rect 100, 100, 100, 100, :center = true @square2 = rect 200, 50, 100, 100 #works as expected @square1.click do animate (24) do |i| @square1.move(100, 100 + (Math.sin(i) * 6).to_i) end end #does not work @square2.click do animate (24) do |i| @square2.move(200, 50 + (Math.sin(i) * 6).to_i) end end end -- Zulfiqar Ali CTO, TimeSvr +65-81386962
Re: About :hidden
Hi K, Thank you for the good information. Linux and Mac are okay. Just Windows problem, I guess. So I'll try again with the next build. :-P Thanks, ashbb On Wed, Oct 15, 2008 at 8:38 AM, Krzysztof B. Wicher [EMAIL PROTECTED]wrote: Works on the latest osx build as well K On Wed, Oct 15, 2008 at 12:08 AM, Satoshi Asakawa [EMAIL PROTECTED]wrote: Thank you, Peter. I forgot to write about my pc. I run the code with Windows XP and Shoes-0.r970. Umm only Windows problem or need to update Shoes build? Regards, ashbb On Wed, Oct 15, 2008 at 2:10 AM, peter retief [EMAIL PROTECTED]wrote: hmm, it works for me? Ubuntu 8.04.1 \n \l shoes raisins (0.r1052) [i486-linux] +video Peter 2008/10/14 Satoshi Asakawa [EMAIL PROTECTED]: Hi all, I'm now studying the latest manual chaper 'The Styles Mster List'. Thank you, _why. It's very helpful for us Shoesers. :) Then I have a question. I wrote the following code and expected to hide all three ovals after three seconds. Blue and green ovals works well, but red one is still showing after others hidden. Shoes.app do elements = [] elements oval(50, 50, 30, :fill = red) elements stack{oval 100, 50, 30, :fill = blue} elements image{oval 150, 50, 30, :fill = green} timer 3 do elements.each{|e| e.hidden = true} end end Umm... spec or bug or missing something? Regards, Satoshi
Re: About :hidden
Thank you, _why. I downloaded the latest build, Shoes-0.r1057, and run this code. It works well!! All three ovals hide after three seconds. Cool! Thanks again, ashbb On Wed, Oct 15, 2008 at 11:11 PM, Satoshi Asakawa [EMAIL PROTECTED] wrote: Hi Dennis, Thanks a lot. Okay, let's confirm this problem on the next build. :-P Satoshi On Wed, Oct 15, 2008 at 11:03 PM, Dennis Woodruff [EMAIL PROTECTED] wrote: Hi Satoshi, I can confirm this is a problem on Windows XP Pro SP3 with r970 Regards Dennis === Hi all, I'm now studying the latest manual chaper 'The Styles Mster List'. Thank you, _why. It's very helpful for us Shoesers. :) Then I have a question. I wrote the following code and expected to hide all three ovals after three seconds. Blue and green ovals works well, but red one is still showing after others hidden. Shoes.app do elements = [] elements oval(50, 50, 30, :fill = red) elements stack{oval 100, 50, 30, :fill = blue} elements image{oval 150, 50, 30, :fill = green} timer 3 do elements.each{|e| e.hidden = true} end end Umm... spec or bug or missing something? Regards, Satoshi
Re: About :hidden
Thank you, Peter. I forgot to write about my pc. I run the code with Windows XP and Shoes-0.r970. Umm only Windows problem or need to update Shoes build? Regards, ashbb On Wed, Oct 15, 2008 at 2:10 AM, peter retief [EMAIL PROTECTED] wrote: hmm, it works for me? Ubuntu 8.04.1 \n \l shoes raisins (0.r1052) [i486-linux] +video Peter 2008/10/14 Satoshi Asakawa [EMAIL PROTECTED]: Hi all, I'm now studying the latest manual chaper 'The Styles Mster List'. Thank you, _why. It's very helpful for us Shoesers. :) Then I have a question. I wrote the following code and expected to hide all three ovals after three seconds. Blue and green ovals works well, but red one is still showing after others hidden. Shoes.app do elements = [] elements oval(50, 50, 30, :fill = red) elements stack{oval 100, 50, 30, :fill = blue} elements image{oval 150, 50, 30, :fill = green} timer 3 do elements.each{|e| e.hidden = true} end end Umm... spec or bug or missing something? Regards, Satoshi
Re: The best way to develop our Shoes apps.
_why and experts - Bluebie, Hugh, MenTaLguY, Thank you for the useful and interesting discussion about this topic. I'll report them to the course students of RubyLearning.org. '#!shoes' and '%x(ruby thingy.rb)' are so cool! I'll take the tips into my Shoes Tutorial note. :) Thanks again, ashbb On Fri, Oct 3, 2008 at 12:57 AM, Hugh Sasse [EMAIL PROTECTED] wrote: On Fri, 3 Oct 2008, Satoshi Asakawa wrote: [...] @all, [...] Is it possible to add the unit testing functonality as the following to Shoes? - Make it possible to start a Shoes app from Ruby. (Without having to type Shoes my_app.rb; just ruby my_app.rb) As long as that is not possible, I do this all the time: example #!shoes Shoes.app do para(Boo!) end __END__ /example That example file has #!shoes on its first line. It will be a .rb script. Shells will see it has a #! line and pass it to shoes. Windows will see it has a .rb extension, pass it to ruby, which will see the #! line and pass it to shoes. I double click on shoes apps and ruby apps alike as a result of this. The only problem is that the icons for a shoes app show up as being ruby apps. Which may not be a problem. Now, from within Ruby code you could %x(thingy.rb) and this would get interpreted by the shell and thus end up being run by shoes. you can't really startup a Shoes app from the inside of a unit test. (You could call a Shoes app with the backticks, but then you wouldn't have a reference to the app object, I think.) If it is in a separate process. But you should be able to put unit tests inside the shoes app, the difficulty is getting the namespacing right. How about this idea? Is it possible or impossible? Regards, ashbb Hugh
The behavior of MP3 file
_why et al, I'm a little confused about this behavior: Shoes.app do button(:select) do @v = video ask_open_file [EMAIL PROTECTED] = '' end button(:play)[EMAIL PROTECTED] button(:stop)[EMAIL PROTECTED] @msg = para '' end In the case of Windows XP and Shoes-0.r970, when I select mp3 file, then the music is played well. Meanwhile, in the case of Windows Vista and Shoes-0.r970, the music isn't played... But omits '#' (executes line 4), then works well. Umm... Strange behavior or for some reason? Regards, ashbb
Re: The best way to develop our Shoes apps.
Hi Bluebie, we are his loyal fleshy unit test. :P Hahaha... that's right! (^^; Testing GUI apps is hard. Oh, I see... but... @all, In the Shoes tutorial discussion forum of RubyLearning.org. Yesterday I got a question (suggestion) about unit testing from one of the participants. Is it possible to add the unit testing functonality as the following to Shoes? - Make it possible to start a Shoes app from Ruby. (Without having to type Shoes my_app.rb; just ruby my_app.rb) As long as that is not possible, you can't really startup a Shoes app from the inside of a unit test. (You could call a Shoes app with the backticks, but then you wouldn't have a reference to the app object, I think.) How about this idea? Is it possible or impossible? Regards, ashbb On Wed, Oct 1, 2008 at 8:38 AM, Bluebie, Jenna [EMAIL PROTECTED]wrote: I thought we were his loyal fleshy unit test. :P Testing GUI apps is hard. On 01/10/2008, at 3:56 AM, Satoshi Asakawa wrote: _why et al, We are now learning Ruby and Shoes on the RubyLearning.org Online Course. :) In the course forum, we were talking about the best way to develop our Shoes pplications. Today in the discussion, RSpec and Unit Tests (zentest, etc) came up. We wondered what it is that you use, and how? Could you give us an example? We'll be so happy to hear that. :) Thanks, ashbb
The best way to develop our Shoes apps.
_why et al, We are now learning Ruby and Shoes on the RubyLearning.org Online Course. :) In the course forum, we were talking about the best way to develop our Shoes pplications. Today in the discussion, RSpec and Unit Tests (zentest, etc) came up. We wondered what it is that you use, and how? Could you give us an example? We'll be so happy to hear that. :) Thanks, ashbb
Re: About the mouse event behavior
Cool!! I'm looking forward to the next Shoes release. :-D Thanks, ashbb On Wed, Sep 10, 2008 at 1:00 PM, _why [EMAIL PROTECTED] wrote: On Wed, Sep 10, 2008 at 08:16:42AM +0900, Satoshi Asakawa wrote: The image (red) oval works the mouse hovering feature but the blue doesn't. Is this a bug or spec? A bug. Nice job, ashbb! A fix was just committed. _why
Fwd: shoes compiling problem - Ubuntu Shoes
@_why Welcome back! My friend Roy have a compiling problem. He posted the following mail but no reply. Could you help him? Regards, ashbb -- Forwarded message -- From: Roy Stannard [EMAIL PROTECTED] Date: Thu, Sep 4, 2008 at 10:20 PM Subject: shoes compiling problem - Ubuntu Shoes To: shoes@code.whytheluckystiff.net Hi guys, New post by a shoes newbie. I have been trying to install shoes on a Ubuntu Hardy box. Firstly, the .run file gave an error message (see attached file. So I tried compiling source. I've run into a problem with rake Rakefile multiple error messages: Package cairo was not found in the pkg-config search path. Perhaps you should add the directory containing `cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found Package cairo was not found in the pkg-config search path. Perhaps you should add the directory containing `cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found Package pango was not found in the pkg-config search path. Perhaps you should add the directory containing `pango.pc' to the PKG_CONFIG_PATH environment variable No package 'pango' found Package pango was not found in the pkg-config search path. Perhaps you should add the directory containing `pango.pc' to the PKG_CONFIG_PATH environment variable No package 'pango' found Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found /home/roy/programming/shoes/Rakefile:298: command not found: curl-config --cflags Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found I've tried to locate PKG_CONFIG_PATH, can't find it Looked at pkg-config, but can't work out what to do with it (if anything) Any help, much appreciated regards Roy attachment: shoes_console_error.png
Re: There's a snake in my shoes!
Hi Erik et al, In my pc, it works with Shoes-0.r925, but it doesn't work with Shoes-0.r905 Just an information, though... :-P Regards, Satoshi On Sat, Sep 6, 2008 at 8:28 PM, Erik Weitnauer [EMAIL PROTECTED]wrote: On Sat, Sep 6, 2008 at 1:21 PM, Erik Weitnauer [EMAIL PROTECTED] wrote: On Fri, Sep 5, 2008 at 4:41 PM, Satoshi Asakawa [EMAIL PROTECTED] wrote: Hi Erik, I'm not sure this is a correct answer, but it works on my pc. :) WindowsXP and Shoes-0.r925 Shoes.app do @img = image(400,400) @img.fill black animate do @img.rect(10, 10, 20, 20).show end end Regards, ashbb Thank you for the reply. Unfortunately it still does not work - the window stays blank when I start shoes with the above code. I use shoes raisins (0.r905) [i486-linux] on Ubuntu 8.04. Any suggestions? Erik. Problem solved! The code works fine when I use the newest version from the git repository (shoes raisins (0.r936) [i486-linux] +video +debug). Erik.
Re: There's a snake in my shoes!
Hi Erik, I'm not sure this is a correct answer, but it works on my pc. :) WindowsXP and Shoes-0.r925 Shoes.app do @img = image(400,400) @img.fill black animate do @img.rect(10, 10, 20, 20).show end end Regards, ashbb On Fri, Sep 5, 2008 at 8:30 AM, Erik Weitnauer [EMAIL PROTECTED]wrote: On Wed, Aug 27, 2008 at 6:17 PM, _why [EMAIL PROTECTED] wrote: On Wed, Aug 27, 2008 at 10:00:58AM -0400, Nick Quaranto wrote: Hi everyone, over the past few days I've been working on a clone of Snake for Shoes. The game is definitely working, and I'd appreciate any feedback that you're willing to give. I'm also running into some slowdown issues as players get snakes that are pretty huge, and the game seems to run slower as someone keeps on playing it. If anyone can help with these issues I'd love to pull your changes :) Hey, great work! I have a few suggestions for how you can speed things up. Probably the way to make things the fastest is to draw on to an image surface. This ends up faster because you don't wind up creating a bunch of Ruby objects for every shape you draw. Basically, here's how to do it: 1. In app.rb, change `Field.new(self)` to `Field.new(image(400, 400))`. 2. In field.rb, change [EMAIL PROTECTED] black` to [EMAIL PROTECTED] #000`. That just creates a 400px by 400px image surface for you to paint on. Now, as alluded, the real reason it's running slow is because Ruby objects are piling up. All the old rectangles are still sitting around every time the snake is drawn. These need to be cleared out. (Unless you use an image surface, as shown above.) So, basically, if you stick with the technique you're using right now, you'll need to call [EMAIL PROTECTED] every time you repaint and then redraw all the shapes from there. _why Hi, I just started with shoes some days ago and I would be glad if anybody could help me about how to get the painting on an image surface to work. I tried with the following code, but it doesn't seem to do what I expected: Shoes.app do @img = image(400,400) @img.fill black animate do @img.rect 10, 10, 20, 20 end end What am I doning wrong? (I want to draw 1000s of tiny boxes / pixels per animation cycle later, so this is why I am trying to use an image surface for it.) Thanks, Erik.
The shit.rb with Shoes 0.r905 has an error.
Happy birthday, Shoes! I downloaded and installed 0.r905 in my WindowsXP box. I tried to run shit.rb (http://gist.github.com/3451) with 0.r905... but it had the following error. Shoes Console Error in C:/Program Files/Common Files/Shoes/0.r905/lib/shoes.rb line 215|Fin Aug 01 01:09:08 +0900 2008 (!) unsupported signal SIGCHLD Just an information. Although you might already know that. :) Thanks, Satoshi
A question about clipboard method
Hi all, I have a question about clipboard method. # get_from_system_clipboard.rb Shoes.app do @l = para '' every(10) do @l.replace clipboard end end get_from_system_clipboard.rb works well on my Windows XP. :) But,... # put_to_system_clipboard.rb Shoes.app do @l = para '' every(10) do clipboard = 'Chanky bacon!' @l.replace clipboard end end put_to_system_clipboard.rb displays 'Chanky bacon!' on the Shoes' app window. But, I do ctl+v on my wordpad, then don't display 'Chanky bacon!'. Umm... I'm confusing... What did I mistake or misunderstand? Anyone suggestion, please. Satoshi
Re: A question about clipboard method
Wow! self.clipboard = 'Clanky bacon!' works well! I didn't notice that. :( Thank you very much. Satoshi On Mon, Jul 21, 2008 at 2:04 AM, _why [EMAIL PROTECTED] wrote: On Sun, Jul 20, 2008 at 05:46:17PM +0900, Satoshi Asakawa wrote: But,... # put_to_system_clipboard.rb Shoes.app do @l = para '' every(10) do clipboard = 'Chanky bacon!' @l.replace clipboard end end put_to_system_clipboard.rb displays 'Chanky bacon!' on the Shoes' app window. Try: self.clipboard = 'Clanky bacon!' _why
Re: Shoes-0.r532 on Windows XP runtime error
@_why Thank you very much. My problem solved with shoes-0.r587. I'm fine. :) Regards, Satoshi On Tue, May 6, 2008 at 1:50 AM, Satoshi Asakawa [EMAIL PROTECTED] wrote: Hi, I'm newbie on Shoes and this is my first mail. If there is FAQ, please let me know. I use MS Windwos XP Professional Version 2002 Service Pack 2. My problem is the following: I wrote my app and run with shoes-0.r396-curious.exe. It works well. But today I updated Shoes upto r532 Then, as I attempted to run it with shoes-0.r532.exe, it doesn't work well. # with shoes-0.r465.exe, the same, not work. :-( When I click this: C:\Program Files\Common Files\Shoes\0.r465\shoes.exe An error message window popups. It shows the following: Can't find an ordinal number 2586 from dynamic library LIBEAY32.dll # This is my traslation(Japanese to English), so might be not correct... Is this by my mistaken install(update) or something is missing? Hope anyone help me, please. Satoshi Asakawa