require 'phi' include Phi require 'comm' form = Form.new :form1, $0 btn = Button.new form, :button1, 'send' btn.align = Phi::AL_CLIENT comm = CommX.new comm.open form.on_close = proc do |sender, action| print "close action=#{action}\n" comm.close end btn.on_click = proc do |sender| print "send\n" comm.send 'abc' end form.show Phi.mainloop