]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/win_gtk.c
wxDefaultSize.* and wxDefaultPosition.* to wxDefaultCoord.
[wxWidgets.git] / src / gtk / win_gtk.c
index 27e2d156bb50c6ce4a580f9e999e70e88e94cfdf..29414cd913efd4f9e4013f9253d4df73cbc728b4 100644 (file)
@@ -1,12 +1,12 @@
 /* ///////////////////////////////////////////////////////////////////////////
 // Name:        win_gtk.c
-// Purpose:     Native GTK+ widget for wxWindows, based on GtkLayout and
+// Purpose:     Native GTK+ widget for wxWidgets, based on GtkLayout and
 //              GtkFixed. It makes use of the gravity window property and
 //              therefore does not work with GTK 1.0.
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////// */
 
 #ifdef VMS
@@ -60,6 +60,8 @@ static void gtk_pizza_draw          (GtkWidget        *widget,
 #endif /* __WXGTK20__ */
 static gint gtk_pizza_expose        (GtkWidget        *widget,
                                      GdkEventExpose   *event);
+static void gtk_pizza_style_set     (GtkWidget *widget,
+                                     GtkStyle  *previous_style);
 static void gtk_pizza_add           (GtkContainer     *container,
                                      GtkWidget        *widget);
 static void gtk_pizza_remove        (GtkContainer     *container,
@@ -164,6 +166,7 @@ gtk_pizza_class_init (GtkPizzaClass *klass)
     widget_class->draw = gtk_pizza_draw;
 #endif
     widget_class->expose_event = gtk_pizza_expose;
+    widget_class->style_set = gtk_pizza_style_set;
 
     container_class->add = gtk_pizza_add;
     container_class->remove = gtk_pizza_remove;
@@ -310,11 +313,11 @@ gtk_pizza_put (GtkPizza   *pizza,
 
     pizza->children = g_list_append (pizza->children, child_info);
 
-    gtk_widget_set_parent (widget, GTK_WIDGET (pizza));
-
     if (GTK_WIDGET_REALIZED (pizza))
       gtk_widget_set_parent_window (widget, pizza->bin_window);
 
+    gtk_widget_set_parent (widget, GTK_WIDGET (pizza));
+
 #ifndef __WXGTK20__ /* FIXME? */
     if (!IS_ONSCREEN (x, y))
        GTK_PRIVATE_SET_FLAG (widget, GTK_IS_OFFSCREEN);
@@ -587,7 +590,7 @@ gtk_pizza_realize (GtkWidget *widget)
     widget->style = gtk_style_attach (widget->style, widget->window);
     gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
     gtk_style_set_background (widget->style, pizza->bin_window, GTK_STATE_NORMAL );
-    
 /*
     gdk_window_set_back_pixmap( widget->window, NULL, FALSE );
     gdk_window_set_back_pixmap( pizza->bin_window, NULL, FALSE );
@@ -807,6 +810,18 @@ gtk_pizza_expose (GtkWidget      *widget,
 #endif
 }
 
+static void
+gtk_pizza_style_set(GtkWidget *widget, GtkStyle  *previous_style)
+{
+    if (GTK_WIDGET_REALIZED(widget))
+    {
+        gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
+        gtk_style_set_background(widget->style, GTK_PIZZA(widget)->bin_window, GTK_STATE_NORMAL );
+    }
+
+    (* GTK_WIDGET_CLASS (pizza_parent_class)->style_set) (widget, previous_style);
+}
+
 static void
 gtk_pizza_add (GtkContainer *container,
                GtkWidget    *widget)