frame
Tcl/Tk
#!/usr/local/bin/wish4.2
frame .f1
frame .f2
pack .f1 .f2 -side left
button .f1.b1 -text "Button1" -command {puts "push button1!!"}
button .f1.b2 -text "Button2" -command {puts "push button2!!"}
button .f2.b -text "Quit" -command exit
pack .f1.b1 .f1.b2 .f2.b -fill x
ruby/Tk
#!/usr/local/bin/ruby
require "tk"
f1 = TkFrame.new {
pack('side' => 'left')
}
f2 = TkFrame.new {
pack('side' => 'left')
}
TkButton.new(f1) {
text 'Button1'
command {print "push button1!!\n"}
pack('fill' => 'x')
}
TkButton.new(f1) {
text 'Button2'
command {print "push button2!!\n"}
pack('fill' => 'x')
}
TkButton.new(f2) {
text 'Quit'
command 'exit'
pack('fill' => 'x')
}
Tk.mainloop