## GtkCellRendererToggle

GtkCellRendererToggle — Renders a toggle button in a cell

## Synopsis

    #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);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkCellRenderer
                   +----GtkCellRendererToggle

## Properties

      "activatable"          gboolean             : Read / Write
      "active"               gboolean             : Read / Write
      "inconsistent"         gboolean             : Read / Write
      "radio"                gboolean             : Read / Write

## Signal Prototypes

    "toggled"   void        user_function      (GtkCellRendererToggle *cellrenderertoggle,
                                                gchar *arg1,
                                                gpointer user_data);

## Description

## Details

### struct GtkCellRendererToggle

    struct GtkCellRendererToggle;

### 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 wether we're rendering radio toggles rather than checkboxes.

`toggle` : | a GtkCellRendererToggle
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).

`toggle` : | a GtkCellRendererToggle
`radio` : | `TRUE` to make the toggle look like a radio button

### 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()`.

`toggle` : | a GtkCellRendererToggle
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.

`toggle` : | a GtkCellRendererToggle.
`setting` : | the value to set.

## Properties

"`activatable`" (gboolean : Read / Write) | The toggle button can be activated.
"`active`" (gboolean : Read / Write) | The toggle state of the button.
"`inconsistent`" (gboolean : Read / Write) | The inconsistent state of the button.
"`radio`" (gboolean : Read / Write) | Draw the toggle button as a radio button.

## Signals

### The "toggled" signal

    void        user_function                  (GtkCellRendererToggle *cellrenderertoggle,
                                                gchar *arg1,
                                                gpointer user_data);

`cellrenderertoggle` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.