Created
June 24, 2010 22:32
-
-
Save fela/452089 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shoes::MyWidget < Shoes::Widget | |
def initialize | |
background blue | |
para "this is MyWidget" | |
end | |
def addpara p | |
para strong(p) | |
p self # this always prints (Shoes::MyWidget) | |
end | |
end | |
Shoes.app do | |
background yellow | |
flow :width => 300, :left => 100 do | |
@w = my_widget | |
end | |
# actually adds to the app | |
@w.addpara "XXX" | |
# the following does what I would have expected (adds the para to the widget) | |
Thread.new do | |
sleep 0.1 # <- this is needed | |
@w.addpara "YYY" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment