The RadioButton Widget : TkRadioButton « Tk « Ruby






The RadioButton Widget


require 'Tk'
top = TkRoot.new{title "Radio Button"}
    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

 








Related examples in the same category