[goffice] GOOptionMenu: cleanup.



commit deef129905eca77b72ce3559bfdf56cbfbc8fae0
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 13 16:47:27 2013 -0400

    GOOptionMenu: cleanup.

 ChangeLog                   |    5 +++++
 NEWS                        |    1 +
 goffice/gtk/go-optionmenu.c |   37 +++++++++++--------------------------
 3 files changed, 17 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5fbe8f0..2226749 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-13  Morten Welinder  <terra gnome org>
+
+       * goffice/gtk/go-optionmenu.c (go_option_menu_init): Be nice and
+       mark composite child.
+
 2013-03-12  Morten Welinder  <terra gnome org>
 
        * goffice/gtk/go-optionmenu.c (go_option_menu_position): Simplify
diff --git a/NEWS b/NEWS
index fe8429d..3cda262 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ goffice 0.10.2:
 Morten:
        * Fix problems with cspline boxed type. [#695550]
        * Fix gtk-doc problems --without-long-double.  [#695550]
+       * Widget cleanups.
 
 --------------------------------------------------------------------------
 goffice 0.10.1:
diff --git a/goffice/gtk/go-optionmenu.c b/goffice/gtk/go-optionmenu.c
index 224d5f8..e22c33f 100644
--- a/goffice/gtk/go-optionmenu.c
+++ b/goffice/gtk/go-optionmenu.c
@@ -36,6 +36,7 @@
 
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
+#include <gsf/gsf-impl-utils.h>
 
 
 enum {
@@ -435,6 +436,8 @@ go_option_menu_init (GOOptionMenu *option_menu)
        GtkBox *box;
        GtkWidget *arrow, *sep;
 
+       gtk_widget_push_composite_child ();
+
        gtk_widget_set_can_focus (GTK_WIDGET (option_menu), TRUE);
        gtk_widget_set_can_default (GTK_WIDGET (option_menu), FALSE);
        gtk_widget_set_receives_default (GTK_WIDGET (option_menu), FALSE);
@@ -456,31 +459,13 @@ go_option_menu_init (GOOptionMenu *option_menu)
        gtk_box_pack_end (box, sep, FALSE, FALSE, 0);
 
        gtk_container_add (GTK_CONTAINER (option_menu), GTK_WIDGET (box));
-}
-
-GType
-go_option_menu_get_type (void)
-{
-       static GType option_menu_type = 0;
-
-       if (!option_menu_type) {
-               static const GTypeInfo option_menu_info =
-                       {
-                               sizeof (GOOptionMenuClass),
-                               NULL,           /* base_init */
-                               NULL,           /* base_finalize */
-                               (GClassInitFunc) go_option_menu_class_init,
-                               NULL,           /* class_finalize */
-                               NULL,           /* class_data */
-                               sizeof (GOOptionMenu),
-                               0,              /* n_preallocs */
-                               (GInstanceInitFunc) go_option_menu_init,
-                       };
-
-               option_menu_type =
-                       g_type_register_static (GTK_TYPE_BUTTON, "GOOptionMenu",
-                                               &option_menu_info, 0);
-       }
 
-       return option_menu_type;
+       gtk_widget_pop_composite_child ();
 }
+
+GSF_CLASS (GOOptionMenu, go_option_menu,
+          go_option_menu_class_init, go_option_menu_init,
+          GTK_TYPE_BUTTON)
+#if 0
+;
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]