require 'rgui/feel/simple' win = RGUI.new_window RGUI.loop
require 'rgui/feel/simple' win = RGUI.new_window btn_hello = win.new_button 'hello' win.add btn_hello win.layout RGUI.loop
btn_hello = win.new_button 'hello'
win.add btn_hello
win.layout
require 'rgui/feel/simple' win = RGUI.new_window btn_hello = win.new_button 'hello' btn_bye = win.new_button 'bye' win.add btn_hello, btn_bye win.layout RGUI.loopあれ ? ボタンはひとつしか表示されません。ウィンドウに置かれた部 品はウィンドウ全体を占めるように広がってしまうのでした。
require 'rgui/feel/simple' win = RGUI.new_window btn_hello = win.new_button 'hello' btn_bye = win.new_button 'bye' hbox = RGUI::Hbox.new true,10,true hbox.add btn_hello, btn_bye win.add hbox win.layout RGUI.loop
hbox = RGUI::Hbox.new true,10,true
hbox.add btn_hello, btn_bye
require 'rgui/feel/simple' win = RGUI.new_window btn_hello = win.new_button 'hello' def btn_hello.clicked; print "hello\n"; end btn_bye = win.new_button 'bye' def btn_bye.clicked; exit if n == 3; end hbox = RGUI::Hbox.new true,10,true hbox.add btn_hello, btn_bye win.add hbox win.layout RGUI.loop
def btn_bye.clicked; exit if n == 3; end