require "phi" 
require "rgui"

form = RGUI::Form.new :form1 , "RGUI sample"

form.add(
  RGUI::Vbox.new.add(
    RGUI::Hbox.new.add(
      btn1 = Phi::Button.new( form , :button1 , "Hello world!"),
      btn2 = Phi::Button.new( form , :button2 )
    ),
    RGUI::Vbox.new(false,0,false).add(
      btn3 = Phi::Button.new( form , :button3 ),
      btn4 = Phi::Button.new( form , :button4 )
    )
  )
)

btn1.on_click = proc{form.caption = "ようこそ Apollo の世界へ"}
btn2.on_click = proc{form.caption = "ぼたん2"}
btn3.on_click = proc{form.caption = "ぼたん3"}
btn4.on_click = proc{form.caption = "ぼたん4"}

form.on_resize = proc{ form.layout }
form.show
Phi.mainloop
