TCheckButton

A themed checkbox. Bind it to a BoolVar to read and control whether it's checked.

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 TCheckButton as a live, theme-aware widget you can interact with.

Example

const on = new BoolVar();
on.value = true; // start checked

const c = app.TCheckButton({ text: 'Enable sync', variable: on });
c.pack.configure({ padx: 16, pady: 8 });

console.log(on.value); // true / false as the user toggles it

Options

Option Type Description
text string The label beside the box.
variable BoolVar Holds the checked state.
onClick function Called when the box is toggled.
onValue / offValue any Values written to variable when checked / unchecked (default 1 / 0).
state string 'normal' or 'disabled'.
style string A ttk style name.
image Photo Optional image.
textVariable StringVar Bind the label text.

Methods

Method Description
invoke() Toggle the checkbox programmatically (runs onClick).

Plus the inherited widget methods — see Widget basics.

See also