require "phi"

form = Phi::Form.new

act = Phi::Action.new
act.caption = "action!"
act.on_execute = proc{|sender,*args| form.caption = "act!! by #{sender.action_component}"}

Phi.new_menu form, :menu, [
  Phi.new_item_ex('&Test1'  , ''         , act ),
  Phi.new_item_ex('&Test2'  , ''         , :mi_test1 , [
    Phi.new_item_ex('&Test3'  , ''         , act ),
  ]),
]

button = Phi::Button.new form
button.action = act
button2 = Phi::Button.new form, nil, "enable_button"
button2.on_click = proc{ act.enabled ^= true }
button2.top = button.bottom

form.show
Phi.mainloop
