]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/win_gtk.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / gtk / win_gtk.cpp
index 0e21432e6aaecd5376d76c53d8c4a82da77bcdfc..d8d901817c34bc19cafb28c23b8197b5323b57ac 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "wx/defs.h"
 #include "wx/gtk/win_gtk.h"
 
 #include "wx/defs.h"
 #include "wx/gtk/win_gtk.h"
+#include "gtk/gtk.h"
 
 /*
 wxPizza is a custom GTK+ widget derived from GtkFixed.  A custom widget
 
 /*
 wxPizza is a custom GTK+ widget derived from GtkFixed.  A custom widget
@@ -166,6 +167,9 @@ static void realize(GtkWidget* widget)
         else
             gdk_window_reparent(widget->window, pizza->m_backing_window, border_x, border_y);
         gdk_window_resize(widget->window, w, h);
         else
             gdk_window_reparent(widget->window, pizza->m_backing_window, border_x, border_y);
         gdk_window_resize(widget->window, w, h);
+        
+        widget->style = gtk_style_attach (widget->style, pizza->m_backing_window);
+        gtk_style_set_background (widget->style, pizza->m_backing_window, GTK_STATE_NORMAL);
     }
 }
 
     }
 }
 
@@ -298,8 +302,8 @@ GtkWidget* wxPizza::New(long windowStyle)
     pizza->m_scroll_x = 0;
     pizza->m_scroll_y = 0;
     pizza->m_is_scrollable = (windowStyle & (wxHSCROLL | wxVSCROLL)) != 0;
     pizza->m_scroll_x = 0;
     pizza->m_scroll_y = 0;
     pizza->m_is_scrollable = (windowStyle & (wxHSCROLL | wxVSCROLL)) != 0;
-    pizza->m_border_style =
-        int(windowStyle & (wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN));
+    // mask off border styles not useable with wxPizza
+    pizza->m_border_style = int(windowStyle & BORDER_STYLES);
     gtk_fixed_set_has_window(GTK_FIXED(widget), true);
     gtk_widget_add_events(widget,
         GDK_EXPOSURE_MASK |
     gtk_fixed_set_has_window(GTK_FIXED(widget), true);
     gtk_widget_add_events(widget,
         GDK_EXPOSURE_MASK |
@@ -317,7 +321,6 @@ GtkWidget* wxPizza::New(long windowStyle)
         GDK_ENTER_NOTIFY_MASK |
         GDK_LEAVE_NOTIFY_MASK |
         GDK_FOCUS_CHANGE_MASK);
         GDK_ENTER_NOTIFY_MASK |
         GDK_LEAVE_NOTIFY_MASK |
         GDK_FOCUS_CHANGE_MASK);
-    gtk_container_set_resize_mode(GTK_CONTAINER(widget), GTK_RESIZE_QUEUE);
     return widget;
 }
 
     return widget;
 }
 
@@ -356,6 +359,8 @@ void wxPizza::scroll(int dx, int dy)
     }
 }
 
     }
 }
 
+extern GtkWidget *GetEntryWidget();
+
 void wxPizza::get_border_widths(int& x, int& y)
 {
     x = y = 0;
 void wxPizza::get_border_widths(int& x, int& y)
 {
     x = y = 0;
@@ -363,11 +368,11 @@ void wxPizza::get_border_widths(int& x, int& y)
         x = y = 1;
     else if (m_border_style)
     {
         x = y = 1;
     else if (m_border_style)
     {
-        GtkWidget* widget = GTK_WIDGET(this);
-        if (widget->style)
+        GtkWidget *entry_widget = GetEntryWidget();
+        if (entry_widget->style)
         {
         {
-            x = widget->style->xthickness;
-            y = widget->style->ythickness;
+            x = entry_widget->style->xthickness;
+            y = entry_widget->style->ythickness;
         }
     }
 }
         }
     }
 }