Fix to dial test allocation. Make wheelbarrow not flash window

before setting shape mask.
This commit is contained in:
Owen Taylor 1998-04-08 05:28:56 +00:00
parent 3d19b7ce55
commit 55f36bac3a
2 changed files with 5 additions and 4 deletions

View File

@ -253,17 +253,18 @@ gtk_dial_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL); g_return_if_fail (allocation != NULL);
widget->allocation = *allocation; widget->allocation = *allocation;
dial = GTK_DIAL (widget);
if (GTK_WIDGET_REALIZED (widget)) if (GTK_WIDGET_REALIZED (widget))
{ {
dial = GTK_DIAL (widget);
gdk_window_move_resize (widget->window, gdk_window_move_resize (widget->window,
allocation->x, allocation->y, allocation->x, allocation->y,
allocation->width, allocation->height); 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 static gint

View File

@ -143,7 +143,7 @@ int main (int argc, char *argv[])
window = gtk_window_new( GTK_WINDOW_POPUP ); window = gtk_window_new( GTK_WINDOW_POPUP );
gtk_signal_connect (GTK_OBJECT (window), "delete_event", gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (close_application), NULL); GTK_SIGNAL_FUNC (close_application), NULL);
gtk_widget_show (window); gtk_widget_realize (window);
/* now for the pixmap and the pixmap widget */ /* now for the pixmap and the pixmap widget */
style = gtk_widget_get_default_style(); style = gtk_widget_get_default_style();