|
Radiobox
The radiobox iwidget provides radiobutton management support. The class supports adding, inserting, deleting, selecting, and configuring radiobuttons as well as obtaining the currently selected button.
For further information, see the Radiobox
manpage
Components: childsite hull label
|
wm title . "Radiobox Example"
##
## Helper proc
##
proc changeFont {} {
.rb configure -labelfont [.rb get]
return
}; # end proc changeFont
##=========================================================
## Create a radiobox iwidget
##=========================================================
##
iwidgets::radiobox .rb \
-labeltext "Select a Font" \
-selectcolor blue
foreach f {times helvetica courier symbol} {
.rb add $f \
-text [string totitle $f]
}
##
## Add a command to the radiobutton
## select
##
.rb configure \
-command {changeFont}
##
## select one of the radiobuttons
##
.rb select symbol
pack .rb \
-padx 10 \
-pady 10 \
-fill both \
-expand yes
|
Download this sample code |
|