[glade3/glade-3-8] * plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly
- Date: Sun, 9 Jan 2011 06:53:07 +0000 (UTC)
commit 2917d90b9d7616ab29d8e46b55bc91879f084de5
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun Jan 9 15:59:33 2011 +0900
* plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly
ChangeLog | 2 ++
plugins/gtk+/glade-gtk.c | 6 ++++++
plugins/gtk+/gtk+.xml.in | 6 ++++++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 45778e8..9c5adfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
* gladeui/glade-editor.c: Make query dialog come with a "Create" button instead
of an "OK" button, closes bug 503621.
+ * plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly
+
2011-01-08 Tristan Van Berkom <tristanvb openismus com>
* plugins/Makefile.am, plugins/glade-tool-item-group-editor.[ch], plugins/gtk+.xml.in,
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index e864ef9..725cd08 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -8468,8 +8468,12 @@ glade_gtk_menu_tool_button_add_child (GladeWidgetAdaptor *adaptor,
GObject *child)
{
if (GTK_IS_MENU (child))
+ {
+ g_object_set_data (child, "special-child-type", "menu");
+
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (object),
GTK_WIDGET (child));
+ }
else
GWA_GET_CLASS (GTK_TYPE_TOOL_BUTTON)->add (adaptor, object, child);
}
@@ -8481,6 +8485,8 @@ glade_gtk_menu_tool_button_remove_child (GladeWidgetAdaptor *adaptor,
{
if (GTK_IS_MENU (child))
{
+ g_object_set_data (child, "special-child-type", NULL);
+
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (object), NULL);
}
else
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 4cfb1a1..d76fce2 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -740,6 +740,12 @@ embedded in another object</_tooltip>
<add-child-function>glade_gtk_menu_tool_button_add_child</add-child-function>
<remove-child-function>glade_gtk_menu_tool_button_remove_child</remove-child-function>
<get-children-function>glade_gtk_menu_tool_button_get_children</get-children-function>
+ <special-child-type>menu</special-child-type>
+
+ <properties>
+ <property id="menu" disabled="True"/>
+ </properties>
+
</glade-widget-class>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]