Next: GtkListStore, Previous: GtkCellRendererText, Up: Top
Renders a toggle button in a cell
<gtk-cell-renderer-toggle> renders a toggle button in a cell. The button
is drawn as a radio- or checkbutton, depending on the radio property. When
activated, it emits the toggled signal.
Derives from
<gtk-cell-renderer>.This class defines the following slots:
activatable- The toggle button can be activated
active- The toggle state of the button
radio- Draw the toggle button as a radio button
inconsistent- The inconsistent state of the button
indicator-size- Size of check or radio indicator
<gchararray>)The ::toggled signal is emitted when the cell is toggled.
<gtk-cell-renderer>)Creates a new
<gtk-cell-renderer-toggle>. Adjust rendering parameters using object properties. Object properties can be set globally (withg-object-set). Also, with<gtk-tree-view-column>, you can bind a property to a value in a<gtk-tree-model>. 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.
- ret
- the new cell renderer
<gtk-cell-renderer-toggle>) (ret bool)Returns whether we're rendering radio toggles rather than checkboxes.
- toggle
- a
<gtk-cell-renderer-toggle>- ret
- ‘
#t’ if we're rendering radio toggles rather than checkboxes
<gtk-cell-renderer-toggle>) (radio bool)If radio is ‘
#t’, the cell renderer renders a radio toggle (i.e. a toggle in a group of mutually-exclusive toggles). If ‘#f’, 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-tree-view>, you set up a per-row setting using<gtk-tree-view-column>to associate model columns with cell renderer properties).
- toggle
- a
<gtk-cell-renderer-toggle>- radio
- ‘
#t’ to make the toggle look like a radio button