| Top | Description | Object Hierarchy | Properties | Signals |
#include <gtk/gtk.h> struct GtkCellRendererToggle; GtkCellRenderer * gtk_cell_renderer_toggle_new (void); gboolean gtk_cell_renderer_toggle_get_radio (GtkCellRendererToggle *toggle); void gtk_cell_renderer_toggle_set_radio (GtkCellRendererToggle *toggle,gboolean radio); gboolean gtk_cell_renderer_toggle_get_active (GtkCellRendererToggle *toggle); void gtk_cell_renderer_toggle_set_active (GtkCellRendererToggle *toggle,gboolean setting); gboolean gtk_cell_renderer_toggle_get_activatable (GtkCellRendererToggle *toggle); void gtk_cell_renderer_toggle_set_activatable (GtkCellRendererToggle *toggle,gboolean setting);
"activatable" gboolean : Read / Write "active" gboolean : Read / Write "inconsistent" gboolean : Read / Write "indicator-size" gint : Read / Write "radio" gboolean : Read / Write
GtkCellRendererToggle renders a toggle button in a cell. The button is drawn as a radio or a checkbutton, depending on the "radio" property. When activated, it emits the "toggled" signal.
GtkCellRenderer * gtk_cell_renderer_toggle_new (void);
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.
Returns : |
the new cell renderer |
gboolean gtk_cell_renderer_toggle_get_radio (GtkCellRendererToggle *toggle);
Returns whether we're rendering radio toggles rather than checkboxes.
|
a GtkCellRendererToggle |
Returns : |
TRUE if we're rendering radio toggles rather than checkboxes |
void gtk_cell_renderer_toggle_set_radio (GtkCellRendererToggle *toggle,gboolean radio);
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).
|
a GtkCellRendererToggle |
|
TRUE to make the toggle look like a radio button |
gboolean gtk_cell_renderer_toggle_get_active (GtkCellRendererToggle *toggle);
Returns whether the cell renderer is active. See
gtk_cell_renderer_toggle_set_active().
|
a GtkCellRendererToggle |
Returns : |
TRUE if the cell renderer is active. |
void gtk_cell_renderer_toggle_set_active (GtkCellRendererToggle *toggle,gboolean setting);
Activates or deactivates a cell renderer.
|
a GtkCellRendererToggle. |
|
the value to set. |
gboolean gtk_cell_renderer_toggle_get_activatable
(GtkCellRendererToggle *toggle);
Returns whether the cell renderer is activatable. See
gtk_cell_renderer_toggle_set_activatable().
|
a GtkCellRendererToggle |
Returns : |
TRUE if the cell renderer is activatable. |
Since 2.18
void gtk_cell_renderer_toggle_set_activatable (GtkCellRendererToggle *toggle,gboolean setting);
Makes the cell renderer activatable.
|
a GtkCellRendererToggle. |
|
the value to set. |
Since 2.18
"activatable" property"activatable" gboolean : Read / Write
The toggle button can be activated.
Default value: TRUE
"active" property"active" gboolean : Read / Write
The toggle state of the button.
Default value: FALSE
"inconsistent" property"inconsistent" gboolean : Read / Write
The inconsistent state of the button.
Default value: FALSE
"indicator-size" property"indicator-size" gint : Read / Write
Size of check or radio indicator.
Allowed values: >= 0
Default value: 16
"radio" property"radio" gboolean : Read / Write
Draw the toggle button as a radio button.
Default value: FALSE
"toggled" signalvoid user_function (GtkCellRendererToggle *cell_renderer,
gchar *path,
gpointer user_data) : Run Last
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.
|
the object which received the signal |
|
string representation of GtkTreePath describing the event location |
|
user data set when the signal handler was connected. |