[gtk+] Add _gtk_toggle_action_set_active() internal function
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add _gtk_toggle_action_set_active() internal function
- Date: Mon, 19 Jul 2010 13:16:59 +0000 (UTC)
commit 1bfa931e2033e81d226483394a90cbbbe33a92b1
Author: Javier Jardón <jjardon gnome org>
Date: Fri Jul 16 18:34:46 2010 +0200
Add _gtk_toggle_action_set_active() internal function
It's needed in gtkradioaction
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624540
gtk/gtkradioaction.c | 4 ++--
gtk/gtktoggleaction.c | 20 ++++++++++++++++++++
gtk/gtktoggleaction.h | 4 ++++
3 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c
index 96f1163..47cb3f4 100644
--- a/gtk/gtkradioaction.c
+++ b/gtk/gtkradioaction.c
@@ -338,7 +338,7 @@ gtk_radio_action_activate (GtkAction *action)
if (gtk_toggle_action_get_active (tmp_action) &&
(tmp_action != toggle_action))
{
- gtk_toggle_action_set_active (toggle_action, !active);
+ _gtk_toggle_action_set_active (toggle_action, !active);
break;
}
@@ -347,7 +347,7 @@ gtk_radio_action_activate (GtkAction *action)
}
else
{
- gtk_toggle_action_set_active (toggle_action, !active);
+ _gtk_toggle_action_set_active (toggle_action, !active);
g_object_notify (G_OBJECT (action), "active");
tmp_list = radio_action->private_data->group;
diff --git a/gtk/gtktoggleaction.c b/gtk/gtktoggleaction.c
index ae82082..86ec59b 100644
--- a/gtk/gtktoggleaction.c
+++ b/gtk/gtktoggleaction.c
@@ -364,3 +364,23 @@ create_menu_item (GtkAction *action)
"draw-as-radio", toggle_action->private_data->draw_as_radio,
NULL);
}
+
+
+/* Private */
+
+/*
+ * _gtk_toggle_action_set_active:
+ * @toggle_action: a #GtkToggleAction
+ * @is_active: whether the action is active or not
+ *
+ * Sets the #GtkToggleAction:active property directly. This function does
+ * not emit signals or notifications: it is left to the caller to do so.
+ */
+void
+_gtk_toggle_action_set_active (GtkToggleAction *toggle_action,
+ gboolean is_active)
+{
+ GtkToggleActionPrivate *priv = toggle_action->private_data;
+
+ priv->active = is_active;
+}
diff --git a/gtk/gtktoggleaction.h b/gtk/gtktoggleaction.h
index c34336e..8896152 100644
--- a/gtk/gtktoggleaction.h
+++ b/gtk/gtktoggleaction.h
@@ -84,6 +84,10 @@ void gtk_toggle_action_set_draw_as_radio (GtkToggleAction *action,
gboolean draw_as_radio);
gboolean gtk_toggle_action_get_draw_as_radio (GtkToggleAction *action);
+/* private */
+void _gtk_toggle_action_set_active (GtkToggleAction *toggle_action,
+ gboolean is_active);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]