require 'phi' require 'rgui/ui' form = RGUI::Form.new(:form1, 'formです') btn1 = Phi::Button.new(form, :button1, 'その1') btn2 = Phi::Button.new(form, :button2, 'その2') btn3 = Phi::Button.new(form, :button3, 'その3') hbox = UI::Hbox.new([btn1, btn2, btn3], 10) form.add(hbox) btn1.on_click = proc do form.layout end btn2.on_click = proc do form.layout end btn3.on_click = proc do form.layout end form.show Phi.mainloop