rubyでTkRadioButtonを使用するサンプル

rubyコード:
require 'Tk’
top = TkRoot.new{title “ボタンのテスト"}
radioVar=TkVariable.new
r1 = TkRadioButton.new(top){
text “Male"
variable radioVar
value 1
}
r1.pack()
r2 = TkRadioButton.new(top){
text “Female"
variable radioVar
value 2
}
r2.pack()
Tk.mainloop

Ruby

Posted by arkgame