TRadioButton

A themed radio button. Radio buttons in a group share one variable; each carries a distinct value, and the shared variable holds whichever button is selected.

Live preview

Try the Theme switcher in the toolbar — this preview restyles live:

Live preview. In the Player's built-in docs viewer (scriptweaver --help), this renders TRadioButton as a live, theme-aware widget you can interact with.

Example

const size = new StringVar('medium');

app.TRadioButton({ text: 'Small', variable: size, value: 'small' });
app.TRadioButton({ text: 'Medium', variable: size, value: 'medium' });
app.TRadioButton({ text: 'Large', variable: size, value: 'large' });

console.log(size.value); // the selected value, e.g. 'medium'

Options

Option Type Description
text string The label.
variable a *Var Shared across the group; holds the selected value.
value any This button's value.
onClick function Called when this button is selected.
state string 'normal' or 'disabled'.
style string A ttk style name.
image Photo Optional image.

Methods

Method Description
invoke() Select this button programmatically (runs onClick).

Plus the inherited widget methods — see Widget basics.

See also