X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0fdaceeb177c53820baf2be167bd892d51d1a8c..aeab10d07c1f4ef78c0c9152de115fa216922e6c:/src/gtk1/win_gtk.c diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c index 7e8498ea5a..0477047b3c 100644 --- a/src/gtk1/win_gtk.c +++ b/src/gtk1/win_gtk.c @@ -9,6 +9,7 @@ #include "wx/gtk/win_gtk.h" #include "gtk/gtksignal.h" +#include "gtk/gtknotebook.h" #ifdef __cplusplus extern "C" { @@ -319,18 +320,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; @@ -381,8 +385,12 @@ gtk_myfixed_size_request (GtkWidget *widget, myfixed = GTK_MYFIXED (widget); +/* requisition->width = 0; requisition->height = 0; +*/ + requisition->width = widget->requisition.width; + requisition->height = widget->requisition.height; children = myfixed->children; while (children) @@ -412,15 +420,17 @@ gtk_myfixed_size_allocate (GtkWidget *widget, g_return_if_fail (allocation != NULL); myfixed = GTK_MYFIXED (widget); - + + widget->allocation = *allocation; #if (GTK_MINOR_VERSION > 0) if (myfixed->shadow_type == GTK_SHADOW_NONE) border = 0; else -#endif border = 2; +#else + border = 0; +#endif - widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) { gdk_window_move_resize( widget->window, @@ -438,8 +448,12 @@ gtk_myfixed_size_allocate (GtkWidget *widget, { child = children->data; children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget)) + + /* please look at the text in wxWindow::DoSetSize() on why the + test GTK_WIDGET_REALIZED() has to be here */ + if (GTK_WIDGET_VISIBLE (child->widget) && + !(!GTK_WIDGET_REALIZED(child->widget) && + GTK_IS_NOTEBOOK(child->widget) )) { child_allocation.x = child->x; child_allocation.y = child->y;