The Radiobutton Widget
Create a radiobutton with the Radiobutton method. A radiobutton has an
indicator to the left of the label indicating whether the button is
selected. It differs from a checkbutton in that only one button may be
selected at a time. Each button in a group of radiobuttons uses the
same variable specified with the -variable option; when selected, the button
assigns that variable the value specified by the -value option.
$parentwidget->Radiobutton (options)The standard configuration options that apply to Radiobutton are: -activeback-ground, -activeforeground, -anchor, -background, -bg, -bitmap, -borderwidth, -bd, -cursor, -disabledforeground, -font, -foreground, -fg, -height, -highlight-background, -highlightcolor, -highlightthickness, -image, -justify, -padx, -pady, -relief, -state, -underline, -width, and -wraplength.
Other options are:
-command =>callbackPointer to a function that will be called when the radiobutton is pressed.
-indicatoron =>booleanDetermines whether to display the indicator. Default is on (
1).-selectcolor =>colorColor of the indicator when the radiobutton is on.
-selectimage =>imgptrDefines the image to be displayed instead of text when the radiobutton is on. Ignored if
-imageis not used.-text =>'text'Defines the text string displayed in the radiobutton. See also
-textvariable.-textvariable =>\$variablePoints to the variable containing text to be displayed in the radiobutton. Button text will change as
$variabledoes.-value =>value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access