Skip to content

Instantly share code, notes, and snippets.

require 'thread'
Shoes.app do
@s = stack do
para "this is a para in the stack.."
end
Thread.new do
sleep 0.1
@s.remove
Shoes.app :width => 500 do
@s1 = stack :margin_left => 50, :height => 1.0 do
background red
para "a b c d e f g h i l m n o p q r s t u v a b c d e f g h 1 2 3 4"
button "show" do
@s1.style(:width => -150)
@s2.show
end
end
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