Gtk.CellRendererToggle

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.CellRenderer Gtk.CellRenderer GObject.InitiallyUnowned->Gtk.CellRenderer GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.CellRendererToggle Gtk.CellRendererToggle Gtk.CellRenderer->Gtk.CellRendererToggle

Subclasses:

None

Methods

Inherited:

Gtk.CellRenderer (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_activatable ()

get_active ()

get_radio ()

set_activatable (setting)

set_active (setting)

set_radio (radio)

Virtual Methods

Inherited:

Gtk.CellRenderer (11), GObject.Object (7)

Properties

Inherited:

Gtk.CellRenderer (15)

Name

Type

Flags

Short Description

activatable

bool

r/w/en

active

bool

r/w/en

inconsistent

bool

r/w/en

radio

bool

r/w/en

Signals

Inherited:

Gtk.CellRenderer (2), GObject.Object (1)

Name

Short Description

toggled

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

Fields

Inherited:

Gtk.CellRenderer (2), GObject.Object (1)

Class Details

class Gtk.CellRendererToggle(**kwargs)
Bases:

Gtk.CellRenderer

Abstract:

No

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.

Deprecated since version 4.10: List views use widgets to display their contents. You should use [class`Gtk`.ToggleButton] instead

classmethod new()[source]
Returns:

the new cell renderer

Return type:

Gtk.CellRenderer

Creates a new GtkCellRendererToggle. Adjust rendering parameters using object properties. Object properties can be set globally (with g_object_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.

get_activatable()[source]
Returns:

True if the cell renderer is activatable.

Return type:

bool

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

Deprecated since version 4.10.

get_active()[source]
Returns:

True if the cell renderer is active.

Return type:

bool

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

Deprecated since version 4.10.

get_radio()[source]
Returns:

True if we’re rendering radio toggles rather than checkboxes

Return type:

bool

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

Deprecated since version 4.10.

set_activatable(setting)[source]
Parameters:

setting (bool) – the value to set.

Makes the cell renderer activatable.

Deprecated since version 4.10.

set_active(setting)[source]
Parameters:

setting (bool) – the value to set.

Activates or deactivates a cell renderer.

Deprecated since version 4.10.

set_radio(radio)[source]
Parameters:

radio (bool) – True to make the toggle look like a radio button

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.

Signal Details

Gtk.CellRendererToggle.signals.toggled(cell_renderer_toggle, path)
Signal Name:

toggled

Flags:

RUN_LAST

Parameters:
  • cell_renderer_toggle (Gtk.CellRendererToggle) – The object which received the signal

  • path (str) – string representation of GtkTreePath describing the event location

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.

Property Details

Gtk.CellRendererToggle.props.activatable
Name:

activatable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Gtk.CellRendererToggle.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Gtk.CellRendererToggle.props.inconsistent
Name:

inconsistent

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Gtk.CellRendererToggle.props.radio
Name:

radio

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY