Gtk.CellRendererToggle¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gtk.CellRenderer (25), GObject.Object (37) | 
|---|---|
| Structs: | Gtk.CellRendererClass (1), GObject.ObjectClass (5) | 
| class | new() | 
| get_activatable() | |
| get_active() | |
| get_radio() | |
| set_activatable(setting) | |
| set_active(setting) | |
| set_radio(radio) | 
Properties¶
| Inherited: | Gtk.CellRenderer (16) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| activatable | bool | r/w/en | The toggle button can be activated | 
| active | bool | r/w/en | The toggle state of the button | 
| inconsistent | bool | r/w/en | The inconsistent state of the button | 
| indicator-size | int | d/r/w/en | Size of check or radio indicator deprecated | 
| radio | bool | r/w/en | Draw the toggle button as a radio button | 
Signals¶
| Inherited: | Gtk.CellRenderer (2), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| toggled | The ::toggledsignal is emitted when the cell is toggled. | 
Fields¶
| Inherited: | Gtk.CellRenderer (2), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | Gtk.CellRenderer | r | 
Class Details¶
- 
class Gtk.CellRendererToggle(**kwargs)¶
- Bases: - Gtk.CellRenderer- Abstract: - No - Structure: - Gtk.CellRendererToggleClass- Gtk.CellRendererTogglerenders a toggle button in a cell. The button is drawn as a radio or a checkbutton, depending on the- Gtk.CellRendererToggle- :radioproperty. When activated, it emits the- Gtk.CellRendererToggle- ::toggledsignal.- 
classmethod new()[source]¶
- Returns: - the new cell renderer - Return type: - Gtk.CellRenderer- Creates a new - Gtk.CellRendererToggle. Adjust rendering parameters using object properties. Object properties can be set globally (with g_object_set()). Also, with- Gtk.TreeViewColumn, you can bind a property to a value in a- Gtk.TreeModel. 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.
 - 
get_activatable()[source]¶
- Returns: - Trueif the cell renderer is activatable.- Return type: - bool- Returns whether the cell renderer is activatable. See - Gtk.CellRendererToggle.set_activatable().- New in version 2.18. 
 - 
get_active()[source]¶
- Returns: - Trueif the cell renderer is active.- Return type: - bool- Returns whether the cell renderer is active. See - Gtk.CellRendererToggle.set_active().
 - 
get_radio()[source]¶
- Returns: - Trueif we’re rendering radio toggles rather than checkboxes- Return type: - bool- Returns whether we’re rendering radio toggles rather than checkboxes. 
 - 
set_activatable(setting)[source]¶
- Parameters: - setting ( - bool) – the value to set.- Makes the cell renderer activatable. - New in version 2.18. 
 - 
set_active(setting)[source]¶
- Parameters: - setting ( - bool) – the value to set.- Activates or deactivates a cell renderer. 
 - 
set_radio(radio)[source]¶
- Parameters: - radio ( - bool) –- Trueto 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- Gtk.TreeView, you set up a per-row setting using- Gtk.TreeViewColumnto associate model columns with cell renderer properties).
 
- 
classmethod 
Signal Details¶
- 
Gtk.CellRendererToggle.signals.toggled(cell_renderer_toggle, path)¶
- Signal Name: - toggled- Flags: - Parameters: - cell_renderer_toggle (Gtk.CellRendererToggle) – The object which received the signal
- path (str) – string representation ofGtk.TreePathdescribing the event location
 - The - ::toggledsignal 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. 
- cell_renderer_toggle (
Property Details¶
- 
Gtk.CellRendererToggle.props.activatable¶
- Name: - activatable- Type: - bool- Default Value: - True- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The toggle button can be activated 
- 
Gtk.CellRendererToggle.props.active¶
- Name: - active- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The toggle state of the button 
- 
Gtk.CellRendererToggle.props.inconsistent¶
- Name: - inconsistent- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The inconsistent state of the button 
- 
Gtk.CellRendererToggle.props.indicator_size¶
- Name: - indicator-size- Type: - int- Default Value: - 0- Flags: - DEPRECATED,- READABLE,- WRITABLE,- EXPLICIT_NOTIFY- Size of check or radio indicator - Deprecated since version ???.