diff options
author | Owen Taylor <owt1@cornell.edu> | 1998-04-03 23:17:16 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-04-03 23:17:16 +0000 |
commit | 32cd050cfe286e636d4df6d96a4b46936279a5a6 (patch) | |
tree | 4f45bb5081e616ff501d984ea7c3481e0d43ab74 /gtk/gtkdrawingarea.c | |
parent | 740b70ea0c1bcdb5943b85ed0bba434f73f9a292 (diff) | |
download | gtk+-32cd050cfe286e636d4df6d96a4b46936279a5a6.tar.gz |
More extensive debugging output
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
gtk/gtkclist.c gtk/gtkeventbox.c gtk/gtkhandlebox.c
gtk/gtk[hv]box.c gtk/gtk[hv]paned.c gtk/gtklist.c
gtk/gtkmenu.c gtk/gtkmenubar.c gtk/gtkmenuitem.c
gtk/gtknotebook.c gtk/gtktable.c gtk/gtktree.c
gtk/gtktreeitem.c gtk/gtkviewport.c
Avoid assigning negative values to unsigned allocation.width and
height
* gtk/gtkwindow.c:
Instead of realizing the widget, then size allocating, (resulting
in XMoveResizeWindows for all children, do the size allocation
first, then realize.
In gtk_real_window_move_resize, combine move and resize
into a single GDK/X call when possible.
* gtk/gtkclist.c gtk/gtkdrawingarea.c:
Remove assumption that the widget will be size allocated _after_
it is realized.
* gtk/gtklist.c (gtk_list_motion_notify): Removed useless
debugging message.
Diffstat (limited to 'gtk/gtkdrawingarea.c')
-rw-r--r-- | gtk/gtkdrawingarea.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c index 8fdb23b0f7..70a9770ffe 100644 --- a/gtk/gtkdrawingarea.c +++ b/gtk/gtkdrawingarea.c @@ -23,6 +23,7 @@ static void gtk_drawing_area_init (GtkDrawingArea *darea); static void gtk_drawing_area_realize (GtkWidget *widget); static void gtk_drawing_area_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void gtk_drawing_area_send_configure (GtkDrawingArea *darea); guint @@ -117,14 +118,14 @@ gtk_drawing_area_realize (GtkWidget *widget) widget->style = gtk_style_attach (widget->style, widget->window); gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); + + gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget)); } static void gtk_drawing_area_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { - GdkEventConfigure event; - g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_DRAWING_AREA (widget)); g_return_if_fail (allocation != NULL); @@ -137,13 +138,24 @@ gtk_drawing_area_size_allocate (GtkWidget *widget, allocation->x, allocation->y, allocation->width, allocation->height); - event.type = GDK_CONFIGURE; - event.window = widget->window; - event.x = allocation->x; - event.y = allocation->y; - event.width = allocation->width; - event.height = allocation->height; - - gtk_widget_event (widget, (GdkEvent*) &event); + gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget)); } } + +static void +gtk_drawing_area_send_configure (GtkDrawingArea *darea) +{ + GtkWidget *widget; + GdkEventConfigure event; + + widget = GTK_WIDGET (darea); + + event.type = GDK_CONFIGURE; + event.window = widget->window; + event.x = widget->allocation.x; + event.y = widget->allocation.y; + event.width = widget->allocation.width; + event.height = widget->allocation.height; + + gtk_widget_event (widget, (GdkEvent*) &event); +} |