]> Pileus Git - ~andy/gtk/commitdiff
Fix to dial test allocation. Make wheelbarrow not flash window
authorOwen Taylor <otaylor@src.gnome.org>
Wed, 8 Apr 1998 05:28:56 +0000 (05:28 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 8 Apr 1998 05:28:56 +0000 (05:28 +0000)
before setting shape mask.

examples/gtkdial/gtkdial.c
examples/wheelbarrow/wheelbarrow.c

index ef0f1a5d8191644a8737e8b67194893be2811046..db759be5d98a810791c99b7aa1d20f547d6a4e78 100644 (file)
@@ -253,17 +253,18 @@ gtk_dial_size_allocate (GtkWidget     *widget,
   g_return_if_fail (allocation != NULL);
 
   widget->allocation = *allocation;
+  dial = GTK_DIAL (widget);
+
   if (GTK_WIDGET_REALIZED (widget))
     {
-      dial = GTK_DIAL (widget);
 
       gdk_window_move_resize (widget->window,
                              allocation->x, allocation->y,
                              allocation->width, allocation->height);
 
-      dial->radius = MAX(allocation->width,allocation->height) * 0.45;
-      dial->pointer_width = dial->radius / 5;
     }
+  dial->radius = MIN(allocation->width,allocation->height) * 0.45;
+  dial->pointer_width = dial->radius / 5;
 }
 
 static gint
index 3d3a60dd28727136ae8695f0af64be30ef297047..e1126c76044e5c9f48c3e87cd2231f91ab44e4a4 100644 (file)
@@ -143,7 +143,7 @@ int main (int argc, char *argv[])
     window = gtk_window_new( GTK_WINDOW_POPUP );
     gtk_signal_connect (GTK_OBJECT (window), "delete_event",
                         GTK_SIGNAL_FUNC (close_application), NULL);
-    gtk_widget_show (window);
+    gtk_widget_realize (window);
 
     /* now for the pixmap and the pixmap widget */
     style = gtk_widget_get_default_style();