]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/win_gtk.c
More for wxPython 2.0b9 (hopefully the last...)
[wxWidgets.git] / src / gtk / win_gtk.c
index 31b638fb6fa48e0ee5488b836d959c8f82e01aed..8dfde26e72c51fc24cb5399be73bcbf03f9b31fa 100644 (file)
@@ -319,18 +319,21 @@ gtk_myfixed_realize (GtkWidget *widget)
   attributes.window_type = GDK_WINDOW_CHILD;
   
 #if (GTK_MINOR_VERSION > 0)
+  attributes.x = widget->allocation.x;
+  attributes.y = widget->allocation.y;
+  attributes.width = widget->allocation.width;
+  attributes.height = widget->allocation.height;
+
   if (myfixed->shadow_type != GTK_SHADOW_NONE)
-    {
-      attributes.x = 2;
-      attributes.y = 2;
-    }
-  else
-    {
-      attributes.x = 0;
-      attributes.y = 0;
-    }
-  attributes.width = MAX (1, (gint)widget->allocation.width - attributes.x * 2 );
-  attributes.height = MAX (1, (gint)widget->allocation.height - attributes.y * 2 );
+  {
+      attributes.x += 2;
+      attributes.y += 2;
+      attributes.width -= 4;
+      attributes.height -= 4;
+  }
+    
+  if (attributes.width < 2) attributes.width = 2;
+  if (attributes.height < 2) attributes.height = 2;
 #else
   attributes.x = widget->allocation.x;
   attributes.y = widget->allocation.y;
@@ -413,21 +416,26 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
 
   myfixed = GTK_MYFIXED (widget);
 
+    widget->allocation = *allocation;
+#if (GTK_MINOR_VERSION > 0)
   if (myfixed->shadow_type == GTK_SHADOW_NONE)
     border = 0;
   else
     border = 2;
+#else
+  border = 0;
+#endif
 
-  widget->allocation = *allocation;
   if (GTK_WIDGET_REALIZED (widget))
   {
     gdk_window_move_resize( widget->window, 
                             allocation->x+border, allocation->y+border, 
 #if (GTK_MINOR_VERSION > 0)
-                           allocation->width-border*2, allocation->height-border*2 );
+                           allocation->width-border*2, allocation->height-border*2
 #else
-                           32000, 32000 );
+                           32000, 32000
 #endif
+                           );
   }
 
   children = myfixed->children;