001 require 'phi' 002 003 form = Phi::Form.new(:form1, 'formです') 004 button1 = Phi::Button.new(form, :button1, 'hoge') 005 button1.width = 200 006 button1.height = 100 007 button1.left = 15 008 button1.top = 15 009 010 button2 = Phi::Button.new(form, :button2, 'foo') 011 button2.width = 30 012 button2.height = 30 013 button2.left = button1.left + button1.width 014 button2.top = button1.top + button1.height 015 016 form.show 017 Phi.mainloop
001 require 'phi' 002 003 form = Phi::Form.new(:form1, 'formです') 004 button1 = Phi::Button.new(form, :button1, 'hoge') 005 button1.align = Phi::AL_LEFT 006 button1.width = 50 007 008 button2 = Phi::Button.new(form, :button2, 'foo') 009 button2.width = 30 010 button2.height = 30 011 button2.anchors = [Phi::AK_RIGHT, AK_TOP] 012 button2.left = form.left - 100 013 button2.top = 30 014 015 form.show 016 Phi.mainloop