require 'phi'
include Phi

form = Form.new
pc = PageControl.new form, :pc
pc.align = Phi::AL_CLIENT

ts1 = TabSheet.new pc, :ts1, 'Hello'
ts2 = TabSheet.new pc, :ts2, 'Good Bye'

i = Button.new ts1, :btn2, 'hello'
i.align = Phi::AL_CLIENT
def i.on_click
  self.caption = Time.now.to_s
  print "clicked\n"
end

i = Button.new ts2, :btn2, 'good bye'
i.align = Phi::AL_CLIENT
def i.on_click
  print "bye....\n"
  parent.parent.parent.close
end
form.show
Phi.mainloop
