Skip to content

Instantly share code, notes, and snippets.

@fela
Created June 24, 2010 22:32
Show Gist options
  • Save fela/452089 to your computer and use it in GitHub Desktop.
Save fela/452089 to your computer and use it in GitHub Desktop.
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