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

open('o', 'wb') do |soc|
  obj = form
  str = Marshal.dump(obj)
  soc.write(str)
end

open('o', 'rb') do |soc|
  obj = Marshal.load(soc)
  p obj
end
