[glade3/glade-3-8] * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu.
- Date: Fri, 17 Dec 2010 13:07:38 +0000 (UTC)
commit 495612a733d043f26eb768aa75122205f48f5c73
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Dec 17 22:13:38 2010 +0900
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu.
ChangeLog | 6 +++++-
plugins/gtk+/glade-gtk.c | 41 +++++++++++++++++++++++++++++++++++++++--
plugins/gtk+/gtk+.xml.in | 7 +++++++
3 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4d3cd66..b772783 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2010-12-18 Tristan Van Berkom <tristanvb openismus com>
+2010-12-17 Tristan Van Berkom <tristanvb openismus com>
+
+ * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu.
+
+2010-12-17 Tristan Van Berkom <tristanvb openismus com>
* NEWS, configure.ac: Rolling 3.7.2.
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index d5c02bf..40965b1 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -9080,8 +9080,11 @@ glade_gtk_spin_button_set_adjustment (GObject *object, const GValue *value)
{
GladeWidget *gadj = glade_widget_get_from_gobject (adj);
- /* Silently set any spin-button adjustment page size to 0 */
- glade_widget_property_set (gadj, "page-size", 0.0F);
+ /* It can be with an old file the GladeWidget is not built yet at load time */
+ if (gadj)
+ /* Silently set any spin-button adjustment page size to 0 */
+ glade_widget_property_set (gadj, "page-size", 0.0F);
+
gtk_adjustment_set_page_size (adj, 0);
}
@@ -9162,6 +9165,40 @@ glade_gtk_combo_get_children (GladeWidgetAdaptor *adaptor, GtkCombo *combo)
return list;
}
+/* ----------------------------- GtkOptionMenu ------------------------------ */
+void
+glade_gtk_option_menu_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ if (GTK_IS_MENU (child))
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (object), GTK_WIDGET (child));
+}
+
+void
+glade_gtk_option_menu_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ if (GTK_IS_MENU (child))
+ gtk_option_menu_remove_menu (GTK_OPTION_MENU (object));
+}
+
+GList *
+glade_gtk_option_menu_get_children (GladeWidgetAdaptor *adaptor,
+ GtkOptionMenu *option_menu)
+{
+ GList *list = NULL;
+ GtkWidget *menu;
+
+ menu = gtk_option_menu_get_menu (option_menu);
+
+ if (menu)
+ list = g_list_prepend (list, menu);
+
+ return list;
+}
+
/* ----------------------------- GtkListItem ------------------------------ */
void
glade_gtk_list_item_post_create (GladeWidgetAdaptor *adaptor,
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index fab6215..445028c 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1750,7 +1750,14 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkOptionMenu" generic-name="optionmenu" _title="Option Menu" deprecated="True" libglade-only="True">
+ <post-create-function>empty</post-create-function>
+ <add-child-function>glade_gtk_option_menu_add_child</add-child-function>
+ <remove-child-function>glade_gtk_option_menu_remove_child</remove-child-function>
+ <get-children-function>glade_gtk_option_menu_get_children</get-children-function>
+
<properties>
+ <property id="menu" disabled="True"/>
+
<!-- Atk press property -->
<property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False">
<parameter-spec>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]