CellRendererToggle

Deprecated since version 4.10: List views use widgets to display their contents. You should use ToggleButton instead

class CellRendererToggle(**properties: Any)

Superclasses: CellRenderer, InitiallyUnowned, Object

Renders a toggle button in a cell

GtkCellRendererToggle renders a toggle button in a cell. The button is drawn as a radio or a checkbutton, depending on the GtkCellRendererToggle:radio property. When activated, it emits the GtkCellRendererToggle::toggled signal.

Constructors

class CellRendererToggle
classmethod new() CellRenderer

Creates a new GtkCellRendererToggle. Adjust rendering parameters using object properties. Object properties can be set globally (with set()). Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel. For example, you can bind the “active” property on the cell renderer to a boolean value in the model, thus causing the check button to reflect the state of the model.

Deprecated since version 4.10: Please do not use it in newly written code

Methods

class CellRendererToggle
get_activatable() bool

Returns whether the cell renderer is activatable. See set_activatable().

Deprecated since version 4.10: Please do not use it in newly written code

get_active() bool

Returns whether the cell renderer is active. See set_active().

Deprecated since version 4.10: Please do not use it in newly written code

get_radio() bool

Returns whether we’re rendering radio toggles rather than checkboxes.

Deprecated since version 4.10: Please do not use it in newly written code

set_activatable(setting: bool) None

Makes the cell renderer activatable.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

setting – the value to set.

set_active(setting: bool) None

Activates or deactivates a cell renderer.

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

setting – the value to set.

set_radio(radio: bool) None

If radio is True, the cell renderer renders a radio toggle (i.e. a toggle in a group of mutually-exclusive toggles). If False, it renders a check toggle (a standalone boolean option). This can be set globally for the cell renderer, or changed just before rendering each cell in the model (for GtkTreeView, you set up a per-row setting using GtkTreeViewColumn to associate model columns with cell renderer properties).

Deprecated since version 4.10: Please do not use it in newly written code

Parameters:

radioTrue to make the toggle look like a radio button

Properties

class CellRendererToggle
props.activatable: bool
props.active: bool
props.inconsistent: bool
props.radio: bool

Signals

class CellRendererToggle.signals
toggled(path: str) None

The ::toggled signal is emitted when the cell is toggled.

It is the responsibility of the application to update the model with the correct value to store at path. Often this is simply the opposite of the value currently stored at path.

Parameters:

path – string representation of GtkTreePath describing the event location