beetlebug▾
/

radiobutton

Makes a radiobutton: one button of a group in which the user selects one choice.

radiobutton PATHNAME ?OPTION VALUE ...?

Description

Makes a radiobutton widget with the name PATHNAME and the options of the call, and makes the command PATHNAME for the widget commands below. The radiobuttons with the same -variable make a group. A click on a radiobutton sets the variable to its -value and runs its -command, and the other radiobuttons of the group show as not selected.

The variable and the group stay equal: a script that sets the variable selects the radiobutton with that value. A value of no radiobutton leaves each radiobutton of the group not selected, and the value of -tristatevalue shows the tristate.

The parent of PATHNAME must exist, and PATHNAME must not. A radiobutton is a Radiobutton in CSS and for the option database, and ztk::class gives it a style class for a stylesheet. The style class segmented draws the radiobuttons of a row as one control with no indicator.

The theme draws the border, the padding, and the indicator, so -borderwidth, -padx, and -pady default to 0, and a value of the script overrides the theme.

Widget commands

CommandDescription
radiobutton deselectDeselects the radiobutton when it is selected.
radiobutton flashFlashes the radiobutton between its active and normal colors.
radiobutton invokeSelects the radiobutton and runs its command, as a click does.
radiobutton selectSelects the radiobutton.
radiobutton cgetGives the value of an option of the radiobutton.
radiobutton configureGives or sets the options of the radiobutton.

Options

OptionTypeDefaultDatabase nameDescription
-activebackgroundcolor#ecececactiveBackgroundThe background color of the active state, in the look of Tk on X11.
-activeforegroundcolor#000000activeForegroundThe text color of the active state, in the look of Tk on X11.
-anchoranchorcenteranchorThe place of the content in a radiobutton larger than it.
-backgroundcolor#d9d9d9backgroundThe background color of the radiobutton.
-bitmapbitmap nameemptybitmapA bitmap name of Tk to show in place of the text.
-borderwidthscreen distance0borderWidthThe width of the border of the radiobutton.
-commandscriptemptycommandA script that runs when the user clicks the radiobutton.
-compoundcompoundnonecompoundShows the image and the text together, with the image at that side.
-cursorcursor nameemptycursorThe shape of the pointer over the radiobutton.
-disabledforegroundcolor#a3a3a3disabledForegroundThe text color while the state is disabled.
-fontfontTkDefaultFontfontThe font of the text.
-foregroundcolor#000000foregroundThe color of the text.
-heightinteger0heightThe height of the radiobutton in lines of text, or in pixels for an image.
-highlightbackgroundcolor#d9d9d9highlightBackgroundThe color of the focus ring while the radiobutton has no focus, in the look of Tk on X11.
-highlightcolorcolor#000000highlightColorThe color of the focus ring while the radiobutton has the focus, in the look of Tk on X11.
-highlightthicknessscreen distance1highlightThicknessThe width of the focus ring, in the look of Tk on X11.
-imagestringemptyimageAn image to show in place of the text.
-indicatoronboolean1indicatorOnWhether the radiobutton draws its indicator.
-justifyjustificationcenterjustifyThe alignment of the lines of the text.
-offreliefreliefraisedoffReliefThe relief of the radiobutton with no indicator while it is not selected.
-overreliefreliefemptyoverReliefThe relief of the radiobutton while the pointer is over it.
-padxscreen distance0padXThe space at the left and the right of the content.
-padyscreen distance0padYThe space above and below the content.
-reliefreliefflatreliefThe 3-D look of the border.
-selectcolorcolor#ffffffselectColorThe background color of the indicator while the radiobutton is selected.
-selectimagestringemptyselectImageThe image to show while the radiobutton is selected.
-statestatenormalstateThe state of the radiobutton: normal, active, or disabled.
-takefocusstringemptytakeFocusWhether the Tab key can move the focus to the radiobutton.
-textstringemptytextThe text of the radiobutton.
-textvariablevariable nameemptytextVariableA global variable whose value is the text of the radiobutton.
-tristateimagestringemptytristateImageThe image to show in the tristate.
-tristatevaluestringemptytristateValueThe value of the variable that puts the radiobutton in the tristate.
-underlineinteger-1underlineThe index of a character of the text to underline, for a keyboard shortcut.
-valuestringemptyvalueThe value of the variable while the radiobutton is selected.
-variablevariable nameselectedButtonvariableThe global variable that the radiobuttons of one group share.
-widthinteger0widthThe width of the radiobutton in characters of the font, or in pixels for an image.
-wraplengthscreen distance0wrapLengthThe longest line of the text before it breaks into a new line.

-activebackground COLOR

The background color of the active state, in the look of Tk on X11.

The background of the radiobutton while the pointer is over it or its state is active. A color is a name such as red, or #RGB, #RRGGBB, or #RRRRGGGGBBBB.

radiobutton with -text Small -variable ::ref::off -value 1 -state active and -activebackground {#ececec}-activebackground {#ececec}radiobutton with -text Small -variable ::ref::off -value 1 -state active and -activebackground {#fde68a}-activebackground {#fde68a}
Each with -text Small -variable ::ref::off -value 1 -state active.
% radiobutton .activebackground -activebackground {#336699}
> .activebackground cget -activebackground
#336699
% radiobutton .activebackground2 -activebackground nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-activeforeground COLOR

The text color of the active state, in the look of Tk on X11.

The color of the text while the pointer is over the radiobutton or its state is active.

radiobutton with -text Small -variable ::ref::off -value 1 -state active and -activeforeground {#888888}-activeforeground {#888888}radiobutton with -text Small -variable ::ref::off -value 1 -state active and -activeforeground {#b91c1c}-activeforeground {#b91c1c}
Each with -text Small -variable ::ref::off -value 1 -state active.
% radiobutton .activeforeground -activeforeground {#336699}
> .activeforeground cget -activeforeground
#336699
% radiobutton .activeforeground2 -activeforeground nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-anchor ANCHOR

The place of the content in a radiobutton larger than it.

When the radiobutton is larger than its text or image, the anchor puts the content at that side or corner. center puts it in the middle.

Values: n, ne, e, se, s, sw, w, nw, center.

radiobutton with -text Small -variable ::ref::off -value 1 -width 14 and -anchor w-anchor wradiobutton with -text Small -variable ::ref::off -value 1 -width 14 and -anchor center-anchor centerradiobutton with -text Small -variable ::ref::off -value 1 -width 14 and -anchor e-anchor e
Each with -text Small -variable ::ref::off -value 1 -width 14.
% radiobutton .anchor -anchor w
> .anchor cget -anchor
w
% radiobutton .anchor2 -anchor middle
bad anchor "middle": must be n, ne, e, se, s, sw, w, nw, or center
-errorcode TCL LOOKUP INDEX anchor middle

-background COLOR

The background color of the radiobutton.

The color behind the content. -bg is the same option. A color is a name such as red, or #RGB, #RRGGBB, or #RRRRGGGGBBBB.

radiobutton with -text Small -variable ::ref::off -value 1 and -background {#fde68a}-background {#fde68a}radiobutton with -text Small -variable ::ref::off -value 1 and -background {#bfdbfe}-background {#bfdbfe}
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .background -background {#336699}
> .background cget -background
#336699
% radiobutton .background2 -background nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-bitmap BITMAP

A bitmap name of Tk to show in place of the text.

The name of a built-in bitmap of Tk, such as error, info, or question. A value that starts with @ names a file. ztk stores the value for cget and shows no bitmap.

% radiobutton .bitmap -bitmap error
> .bitmap cget -bitmap
error
% radiobutton .bitmap2 -bitmap nobitmap
bitmap "nobitmap" not defined
-errorcode TK LOOKUP BITMAP nobitmap

-borderwidth DISTANCE

The width of the border of the radiobutton.

The width of the border around the radiobutton. -bd is the same option. The default 0 leaves the border to the theme, and a value of the script replaces it. A distance is a count of pixels, or a number with c, i, m, or p for centimeters, inches, millimeters, or points.

radiobutton with -text Small -variable ::ref::off -value 1 -relief solid and -borderwidth 0-borderwidth 0radiobutton with -text Small -variable ::ref::off -value 1 -relief solid and -borderwidth 1-borderwidth 1radiobutton with -text Small -variable ::ref::off -value 1 -relief solid and -borderwidth 4-borderwidth 4
Each with -text Small -variable ::ref::off -value 1 -relief solid.
% radiobutton .borderwidth -borderwidth 4
> .borderwidth cget -borderwidth
4
% radiobutton .borderwidth2 -borderwidth x
bad screen distance "x"
-errorcode TK VALUE PIXELS

-command SCRIPT

A script that runs when the user clicks the radiobutton.

The script runs at the global level after the radiobutton changes its variable. invoke runs it too.

% radiobutton .command -command {set ::done 1}
> .command cget -command
set ::done 1

ztk stores each script with no check. An error of the script is the error of invoke.

-compound WORD

Shows the image and the text together, with the image at that side.

With none, a radiobutton with an -image shows only the image. Each other value shows the image and the text, with the image at that side of the text, or under the text with center.

Values: bottom, center, left, none, right, top.

% radiobutton .compound -compound bottom
> .compound cget -compound
bottom
% radiobutton .compound2 -compound bogus
bad compound "bogus": must be bottom, center, left, none, right, or top
-errorcode TCL LOOKUP INDEX compound bogus

-cursor CURSOR

The shape of the pointer over the radiobutton.

A cursor name of Tk, such as hand2 or xterm. A value that starts with @ names a file. An empty value uses the cursor of the parent.

% radiobutton .cursor -cursor hand2
> .cursor cget -cursor
hand2
% radiobutton .cursor2 -cursor nocursor
bad cursor spec "nocursor"
-errorcode TK VALUE CURSOR

-disabledforeground COLOR

The text color while the state is disabled.

The color of the text while -state is disabled.

radiobutton with -text Small -variable ::ref::off -value 1 -state disabled and -disabledforeground {#888888}-disabledforeground {#888888}radiobutton with -text Small -variable ::ref::off -value 1 -state disabled and -disabledforeground {#b91c1c}-disabledforeground {#b91c1c}
Each with -text Small -variable ::ref::off -value 1 -state disabled.
% radiobutton .disabledforeground -disabledforeground {#336699}
> .disabledforeground cget -disabledforeground
#336699
% radiobutton .disabledforeground2 -disabledforeground nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-font FONT

The font of the text.

A font name, such as TkDefaultFont, or a font description, such as {Helvetica 12 bold}. A family that does not exist falls back to a font of the system.

radiobutton with -text Small -variable ::ref::off -value 1 and -font TkDefaultFont-font TkDefaultFontradiobutton with -text Small -variable ::ref::off -value 1 and -font TkFixedFont-font TkFixedFontradiobutton with -text Small -variable ::ref::off -value 1 and -font {Helvetica 16 bold}-font {Helvetica 16 bold}
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .font -font {Helvetica 12 bold}
> .font cget -font
Helvetica 12 bold
% radiobutton .font2 -font {Helvetica big}
expected integer but got "big"
-errorcode TCL VALUE NUMBER

-foreground COLOR

The color of the text.

The color of the text. -fg is the same option. A color is a name such as red, or #RGB, #RRGGBB, or #RRRRGGGGBBBB.

radiobutton with -text Small -variable ::ref::off -value 1 and -foreground {#b91c1c}-foreground {#b91c1c}radiobutton with -text Small -variable ::ref::off -value 1 and -foreground {#2563eb}-foreground {#2563eb}
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .foreground -foreground {#336699}
> .foreground cget -foreground
#336699
% radiobutton .foreground2 -foreground nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-height LINES

The height of the radiobutton in lines of text, or in pixels for an image.

For a radiobutton with text, the height in lines of the font. For a radiobutton with an image, the height in pixels. 0 makes the radiobutton as tall as its content.

radiobutton with -text Small -variable ::ref::off -value 1 and -height 0-height 0radiobutton with -text Small -variable ::ref::off -value 1 and -height 2-height 2radiobutton with -text Small -variable ::ref::off -value 1 and -height 3-height 3
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .height -height 5
> .height cget -height
5
% radiobutton .height2 -height x
expected integer but got "x"
-errorcode TCL VALUE NUMBER

-highlightbackground COLOR

The color of the focus ring while the radiobutton has no focus, in the look of Tk on X11.

The color of the highlight ring of -highlightthickness while the radiobutton does not have the focus. ztk stores the value with no effect.

% radiobutton .highlightbackground -highlightbackground {#336699}
> .highlightbackground cget -highlightbackground
#336699
% radiobutton .highlightbackground2 -highlightbackground nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-highlightcolor COLOR

The color of the focus ring while the radiobutton has the focus, in the look of Tk on X11.

The color of the highlight ring of -highlightthickness while the radiobutton has the focus. ztk stores the value with no effect.

% radiobutton .highlightcolor -highlightcolor {#336699}
> .highlightcolor cget -highlightcolor
#336699
% radiobutton .highlightcolor2 -highlightcolor nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-highlightthickness DISTANCE

The width of the focus ring, in the look of Tk on X11.

The width of the ring around the radiobutton that shows the focus. The modern theme draws the focus with the stylesheet.

% radiobutton .highlightthickness -highlightthickness 4
> .highlightthickness cget -highlightthickness
4
% radiobutton .highlightthickness2 -highlightthickness x
bad screen distance "x"
-errorcode TK VALUE PIXELS

-image TEXT

An image to show in place of the text.

The name of an image of image create. With an image and -compound none, the radiobutton shows the image and no text.

% radiobutton .image -image pic
> .image cget -image
pic

ztk stores each name with no check. Tk 8.6.16 gives an error for an image that does not exist.

-indicatoron BOOLEAN

Whether the radiobutton draws its indicator.

With a false value, the radiobutton draws no indicator.

radiobutton with -text Small -variable ::ref::off -value 1 and -indicatoron 1-indicatoron 1radiobutton with -text Small -variable ::ref::off -value 1 and -indicatoron 0-indicatoron 0
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .indicatoron -indicatoron 0
> .indicatoron cget -indicatoron
0
% radiobutton .indicatoron2 -indicatoron maybe
expected boolean value but got "maybe"
-errorcode TCL VALUE NUMBER

-justify SIDE

The alignment of the lines of the text.

How the lines of a text with more than one line line up with each other. A text breaks into lines at each newline and at -wraplength.

Values: left, right, center.

radiobutton with -text Short
A longer line -variable ::ref::off -value 1 and -justify left-justify leftradiobutton with -text Short
A longer line -variable ::ref::off -value 1 and -justify center-justify centerradiobutton with -text Short
A longer line -variable ::ref::off -value 1 and -justify right-justify right
Each with -text Short A longer line -variable ::ref::off -value 1.
% radiobutton .justify -justify left
> .justify cget -justify
left
% radiobutton .justify2 -justify middle
bad justification "middle": must be left, right, or center
-errorcode TCL LOOKUP INDEX justification middle

-offrelief RELIEF

The relief of the radiobutton with no indicator while it is not selected.

With -indicatoron 0, Tk draws a radiobutton that is not selected with this relief. ztk stores the value with no effect.

Values: flat, groove, raised, ridge, solid, sunken.

% radiobutton .offrelief -offrelief groove
> .offrelief cget -offrelief
groove
% radiobutton .offrelief2 -offrelief bumpy
bad relief "bumpy": must be flat, groove, raised, ridge, solid, or sunken
-errorcode TCL LOOKUP INDEX relief bumpy

-overrelief RELIEF

The relief of the radiobutton while the pointer is over it.

An empty value keeps the relief of -relief. ztk stores the value with no effect.

Values: flat, groove, raised, ridge, solid, sunken.

% radiobutton .overrelief -overrelief groove
> .overrelief cget -overrelief
groove
% radiobutton .overrelief2 -overrelief bumpy
bad relief "bumpy": must be flat, groove, raised, ridge, solid, or sunken
-errorcode TCL LOOKUP INDEX relief bumpy

-padx DISTANCE

The space at the left and the right of the content.

The default 0 leaves the padding to the theme, and a value of the script replaces the padding of the theme at both sides.

radiobutton with -text Small -variable ::ref::off -value 1 and -padx 1-padx 1radiobutton with -text Small -variable ::ref::off -value 1 and -padx 4-padx 4radiobutton with -text Small -variable ::ref::off -value 1 and -padx 16-padx 16
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .padx -padx 4
> .padx cget -padx
4
% radiobutton .padx2 -padx x
bad screen distance "x"
-errorcode TK VALUE PIXELS

-pady DISTANCE

The space above and below the content.

The default 0 leaves the padding to the theme, and a value of the script replaces the padding of the theme above and below.

radiobutton with -text Small -variable ::ref::off -value 1 and -pady 1-pady 1radiobutton with -text Small -variable ::ref::off -value 1 and -pady 2-pady 2radiobutton with -text Small -variable ::ref::off -value 1 and -pady 10-pady 10
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .pady -pady 4
> .pady cget -pady
4
% radiobutton .pady2 -pady x
bad screen distance "x"
-errorcode TK VALUE PIXELS

-relief RELIEF

The 3-D look of the border.

The style of the border: raised and sunken look 3-D, and groove and ridge are lines. The theme draws the border, and the CSS of the theme can give a relief its own look with border-style.

Values: flat, groove, raised, ridge, solid, sunken.

radiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief flat-relief flatradiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief raised-relief raisedradiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief sunken-relief sunkenradiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief groove-relief grooveradiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief ridge-relief ridgeradiobutton with -text Small -variable ::ref::off -value 1 -borderwidth 4 and -relief solid-relief solid
Each with -text Small -variable ::ref::off -value 1 -borderwidth 4. The modern theme draws each relief but flat with the same border.
% radiobutton .relief -relief groove
> .relief cget -relief
groove
% radiobutton .relief2 -relief bumpy
bad relief "bumpy": must be flat, groove, raised, ridge, solid, or sunken
-errorcode TCL LOOKUP INDEX relief bumpy

-selectcolor COLOR

The background color of the indicator while the radiobutton is selected.

In Tk, the fill of the indicator while the radiobutton is selected. ztk stores the value with no effect: the theme gives the color of the indicator.

% radiobutton .selectcolor -selectcolor {#336699}
> .selectcolor cget -selectcolor
#336699
% radiobutton .selectcolor2 -selectcolor nocolor
unknown color name "nocolor"
-errorcode TK LOOKUP COLOR nocolor

-selectimage TEXT

The image to show while the radiobutton is selected.

In Tk, a radiobutton with an -image shows this image in place of -image while it is selected.

% radiobutton .selectimage -selectimage pic
> .selectimage cget -selectimage
pic

ztk stores each name with no check. Tk 8.6.16 gives an error for an image that does not exist.

-state STATE

The state of the radiobutton: normal, active, or disabled.

disabled draws the text with -disabledforeground, and a click or invoke has no effect. active uses the colors of -activebackground and -activeforeground. select changes the variable in each state.

Values: active, disabled, normal.

radiobutton with -text Small -variable ::ref::off -value 1 and -state normal-state normalradiobutton with -text Small -variable ::ref::off -value 1 and -state active-state activeradiobutton with -text Small -variable ::ref::off -value 1 and -state disabled-state disabled
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .state -state disabled
> .state cget -state
disabled
% radiobutton .state2 -state busy
bad state "busy": must be active, disabled, or normal
-errorcode TCL LOOKUP INDEX state busy

-takefocus TEXT

Whether the Tab key can move the focus to the radiobutton.

1 puts the radiobutton in the order of the Tab key, and 0 leaves it out. An empty value uses the default rule of Tk for the widget. In Tk the value can also be a script, and its result is the answer. ztk stores each value with no check.

% radiobutton .takefocus -takefocus 1
> .takefocus cget -takefocus
1

ztk stores each value of the option with no check.

-text TEXT

The text of the radiobutton.

The text that the radiobutton shows. A newline starts a new line.

radiobutton with -variable ::ref::off -value 1 and -text Small-text Smallradiobutton with -variable ::ref::off -value 1 and -text {Small and more}-text {Small and more}
Each with -variable ::ref::off -value 1.
% radiobutton .text -text Save
> .text cget -text
Save

Each string is a valid text.

-textvariable VAR

A global variable whose value is the text of the radiobutton.

The radiobutton shows the value of the global variable VAR, and changes its text when the variable changes. The variable stays after the radiobutton is destroyed.

% radiobutton .textvariable -textvariable v
> .textvariable cget -textvariable
v

Each name is a valid variable name.

-tristateimage TEXT

The image to show in the tristate.

With an -image, Tk shows this image while the variable has the value of -tristatevalue.

% radiobutton .tristateimage -tristateimage pic
> .tristateimage cget -tristateimage
pic

ztk stores each name with no check. Tk 8.6.16 gives an error for an image that does not exist.

-tristatevalue TEXT

The value of the variable that puts the radiobutton in the tristate.

When the variable has this value, the radiobutton shows the tristate: neither on nor off.

% radiobutton .tristatevalue -tristatevalue maybe
> .tristatevalue cget -tristatevalue
maybe

Each string is a valid value.

-underline N

The index of a character of the text to underline, for a keyboard shortcut.

The index from 0 of the character of -text to underline. -1 underlines no character.

% radiobutton .underline -underline 5
> .underline cget -underline
5
% radiobutton .underline2 -underline x
expected integer but got "x"
-errorcode TCL VALUE NUMBER

-value TEXT

The value of the variable while the radiobutton is selected.

select and a click set the variable to this value. Each radiobutton of a group has a different value.

% radiobutton .value -value red -variable color
> .value select
> set color
red

Each string is a valid value.

-variable VAR

The global variable that the radiobuttons of one group share.

The radiobutton is selected while the variable has the value of -value. The radiobuttons with the same variable make one group, so the selection of one radiobutton deselects the others. The default variable is selectedButton. When the variable has no value, the radiobutton sets it to an empty string.

% radiobutton .variable -variable size -value small
> radiobutton .variable2 -variable size -value large
> .variable2 invoke
> set size
large

# The default variable.
% radiobutton .variable3
> .variable3 cget -variable
selectedButton

Each name is a valid variable name.

-width CHARS

The width of the radiobutton in characters of the font, or in pixels for an image.

For a radiobutton with text, the width in average characters of the font. For a radiobutton with an image, the width in pixels. 0 makes the radiobutton as wide as its content.

radiobutton with -text Small -variable ::ref::off -value 1 and -width 0-width 0radiobutton with -text Small -variable ::ref::off -value 1 and -width 8-width 8radiobutton with -text Small -variable ::ref::off -value 1 and -width 14-width 14
Each with -text Small -variable ::ref::off -value 1.
% radiobutton .width -width 5
> .width cget -width
5
% radiobutton .width2 -width x
expected integer but got "x"
-errorcode TCL VALUE NUMBER

-wraplength DISTANCE

The longest line of the text before it breaks into a new line.

A text longer than this distance breaks at a space into more lines. 0 breaks no line.

% radiobutton .wraplength -wraplength 4
> .wraplength cget -wraplength
4
% radiobutton .wraplength2 -wraplength x
bad screen distance "x"
-errorcode TK VALUE PIXELS

Bindings

EventDescription
<Enter>The pointer is over the button: it shows the active colors.
<Leave>The pointer leaves the button, and the active colors go.
<Button-1>A press sets the variable to the -value of the button and runs the -command script at once, as invoke does. A press on a disabled button changes no value.
<Key-space>Sets the variable to the -value of the button and runs the -command script, as invoke does.
<Key-Return>The same as the space key.

Virtual events

EventDescription
<<Invoke>>The same as the space key. event generate .r <<Invoke>> sends it.

Returns

PATHNAME.

Examples

% radiobutton .small -text Small -variable size -value small
> radiobutton .large -text Large -variable size -value large
> .large invoke
> set size
large

% radiobutton .red -text Red -variable color -value red
> set color red
> .red cget -value
red

% winfo class [radiobutton .go]
Radiobutton

Errors

% radiobutton .x -foo 1
unknown option "-foo"
-errorcode TK LOOKUP OPTION -foo

% radiobutton .twice
> radiobutton .twice
window name "twice" already exists in parent
-errorcode TK VALUE WINDOW EXISTS

# The parent .no does not exist.
% radiobutton .no.b
bad window path name ".no"
-errorcode TK LOOKUP WINDOW .no

% radiobutton
wrong # args: should be "radiobutton pathName ?-option value ...?"
-errorcode TCL WRONGARGS

Differences from Tcl

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also