require 'phi'
include Phi

form = Form.new
i = Button.new form, :btn, 'hello'
i.align = Phi::AL_CLIENT
def i.on_click
  self.caption = Time.now.to_s
  print "clicked\n"
end
form.show
open('form.afm', 'wb').print form._dump 3
open('btn1.afm', 'wb').print form.btn._dump -1
Phi.mainloop
