GtkCellRendererToggle
GtkCellRendererToggle — Renders a toggle button in a cell
Functions
GtkCellRenderer * | gtk_cell_renderer_toggle_new () |
gboolean | gtk_cell_renderer_toggle_get_radio () |
void | gtk_cell_renderer_toggle_set_radio () |
gboolean | gtk_cell_renderer_toggle_get_active () |
void | gtk_cell_renderer_toggle_set_active () |
gboolean | gtk_cell_renderer_toggle_get_activatable () |
void | gtk_cell_renderer_toggle_set_activatable () |
Properties
gboolean | activatable | Read / Write |
gboolean | active | Read / Write |
gboolean | inconsistent | Read / Write |
int | indicator-size | Read / Write |
gboolean | radio | Read / Write |
Signals
void | toggled | Run Last |
Types and Values
struct | GtkCellRendererToggle |
Object Hierarchy
GObject ╰── GInitiallyUnowned ╰── GtkCellRenderer ╰── GtkCellRendererToggle
Includes
#include <gtk/gtk.h>
Description
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.
Functions
gtk_cell_renderer_toggle_new ()
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
gtk_cell_renderer_toggle_get_radio ()
gboolean
gtk_cell_renderer_toggle_get_radio (GtkCellRendererToggle *toggle
);
Returns whether we’re rendering radio toggles rather than checkboxes.
Parameters
toggle |
Returns
TRUE
if we’re rendering radio toggles rather than checkboxes
gtk_cell_renderer_toggle_set_radio ()
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).
Parameters
toggle | ||
radio |
|
gtk_cell_renderer_toggle_get_active ()
gboolean
gtk_cell_renderer_toggle_get_active (GtkCellRendererToggle *toggle
);
Returns whether the cell renderer is active. See gtk_cell_renderer_toggle_set_active()
.
Parameters
toggle |
Returns
TRUE
if the cell renderer is active.
gtk_cell_renderer_toggle_set_active ()
void gtk_cell_renderer_toggle_set_active (GtkCellRendererToggle *toggle
,gboolean setting
);
Activates or deactivates a cell renderer.
Parameters
toggle | ||
setting | the value to set. |
gtk_cell_renderer_toggle_get_activatable ()
gboolean
gtk_cell_renderer_toggle_get_activatable
(GtkCellRendererToggle *toggle
);
Returns whether the cell renderer is activatable. See gtk_cell_renderer_toggle_set_activatable()
.
Parameters
toggle |
Returns
TRUE
if the cell renderer is activatable.
Since: 2.18
gtk_cell_renderer_toggle_set_activatable ()
void gtk_cell_renderer_toggle_set_activatable (GtkCellRendererToggle *toggle
,gboolean setting
);
Makes the cell renderer activatable.
Parameters
toggle | ||
setting | the value to set. |
Since: 2.18
Types and Values
struct GtkCellRendererToggle
struct GtkCellRendererToggle;
Property Details
The “activatable”
property
“activatable” gboolean
The toggle button can be activated.
Owner: GtkCellRendererToggle
Flags: Read / Write
Default value: TRUE
The “active”
property
“active” gboolean
The toggle state of the button.
Owner: GtkCellRendererToggle
Flags: Read / Write
Default value: FALSE
The “inconsistent”
property
“inconsistent” gboolean
The inconsistent state of the button.
Owner: GtkCellRendererToggle
Flags: Read / Write
Default value: FALSE
The “indicator-size”
property
“indicator-size” int
Size of check or radio indicator.
Owner: GtkCellRendererToggle
Flags: Read / Write
Allowed values: >= 0
Default value: 0
The “radio”
property
“radio” gboolean
Draw the toggle button as a radio button.
Owner: GtkCellRendererToggle
Flags: Read / Write
Default value: FALSE
Signal Details
The “toggled”
signal
void user_function (GtkCellRendererToggle *cell_renderer, char *path, gpointer user_data)
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
cell_renderer | the object which received the signal | |
path | string representation of GtkTreePath describing the event location | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk3/3.24/GtkCellRendererToggle.html