]> 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 fecb23b7f50ea549fd8dcc008dd8696d2cdeb20b..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;
@@ -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)