summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrenderertoggle.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@gimp.org>2009-07-14 01:53:56 +0200
committerMichael Natterer <mitch@gimp.org>2009-07-14 01:53:56 +0200
commit66ae394eb5681f16b8c47a88fccc9f0136438726 (patch)
treeb931db873dbbb59a1553bf1e6166ae27f70364f5 /gtk/gtkcellrenderertoggle.c
parentdffc1bf19da9d2f071ee692478e8fca2a77ac600 (diff)
downloadgtk+-66ae394eb5681f16b8c47a88fccc9f0136438726.tar.gz
Add API for the sealed member "activatable"
Diffstat (limited to 'gtk/gtkcellrenderertoggle.c')
-rw-r--r--gtk/gtkcellrenderertoggle.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 5cc826ca9b..008c84109b 100644
--- a/gtk/gtkcellrenderertoggle.c
+++ b/gtk/gtkcellrenderertoggle.c
@@ -482,5 +482,46 @@ gtk_cell_renderer_toggle_set_active (GtkCellRendererToggle *toggle,
g_object_set (toggle, "active", setting ? TRUE : FALSE, NULL);
}
+/**
+ * gtk_cell_renderer_toggle_get_activatable:
+ * @toggle: a #GtkCellRendererToggle
+ *
+ * Returns whether the cell renderer is activatable. See
+ * gtk_cell_renderer_toggle_set_activatable().
+ *
+ * Return value: %TRUE if the cell renderer is activatable.
+ *
+ * Since: 2.18
+ **/
+gboolean
+gtk_cell_renderer_toggle_get_activatable (GtkCellRendererToggle *toggle)
+{
+ g_return_val_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (toggle), FALSE);
+
+ return toggle->activatable;
+}
+
+/**
+ * gtk_cell_renderer_toggle_set_activatable:
+ * @toggle: a #GtkCellRendererToggle.
+ * @setting: the value to set.
+ *
+ * Makes the cell renderer activatable.
+ *
+ * Since: 2.18
+ **/
+void
+gtk_cell_renderer_toggle_set_activatable (GtkCellRendererToggle *toggle,
+ gboolean setting)
+{
+ g_return_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (toggle));
+
+ if (toggle->activatable != setting)
+ {
+ toggle->activatable = setting ? TRUE : FALSE;
+ g_object_notify (G_OBJECT (toggle), "activatable");
+ }
+}
+
#define __GTK_CELL_RENDERER_TOGGLE_C__
#include "gtkaliasdef.c"