36. Ok, here's more examples Shoes.app:title=>'Sample'do button"Click"do alert"WHOA!" end end
37. and more.... Shoes.app:width=>640,:height=>480do background"#f90" @self=self button"Change Color"do bgcolor=ask_color("Pick a new background color") @self.appdo background bgcolor end end end
38. and more.... Shoes.appdo @self =self left, top =nil, nil line_sizes = {large:10, medium:5, small:1} line_color, line_width = red, line_sizes[:medium] stroke line_color strokewidth line_width animate 24do b, x, y = @self.mouse line(left, top, x, y) if b ==1 left, top = x, y end button("clear") { background "#fff" } button("New Color") { @self.stroke ask_color("Pick a new background color") } list_box items: ["Large", "Medium", "Small"], choose:'Medium'do |selected| @self.strokewidth line_sizes[selected.text.downcase.to_sym] end end # BAM! Paint program in 18 lines of ruby :)