diff options
author | Benjamin Otte <otte@redhat.com> | 2010-09-09 00:33:57 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:11:41 +0200 |
commit | c6f28c3dbcf39e36b23402a99b4a3f589c94cec3 (patch) | |
tree | 28b22da4949f6d3ec518a38b97de983dbe31b08a /tests | |
parent | 07d0c0b92165ce65048b1272cb33f2e10af1b7f3 (diff) | |
download | gtk+-c6f28c3dbcf39e36b23402a99b4a3f589c94cec3.tar.gz |
testtooltips: Connect to draw signal
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testtooltips.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/tests/testtooltips.c b/tests/testtooltips.c index 35a7de0feb..4c17846797 100644 --- a/tests/testtooltips.c +++ b/tests/testtooltips.c @@ -205,23 +205,14 @@ query_tooltip_drawing_area_cb (GtkWidget *widget, } static gboolean -drawing_area_expose (GtkWidget *drawing_area, - GdkEventExpose *event, - gpointer data) +drawing_area_draw (GtkWidget *drawing_area, + cairo_t *cr, + gpointer data) { - GtkAllocation allocation; - GdkWindow *window; gint i; - cairo_t *cr; - window = gtk_widget_get_window (drawing_area); - - cr = gdk_cairo_create (window); - - gtk_widget_get_allocation (drawing_area, &allocation); - cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); - cairo_fill (cr); + cairo_paint (cr); for (i = 0; i < G_N_ELEMENTS (rectangles); i++) { @@ -236,8 +227,6 @@ drawing_area_expose (GtkWidget *drawing_area, cairo_fill (cr); } - cairo_destroy (cr); - return FALSE; } @@ -402,8 +391,8 @@ main (int argc, char *argv[]) drawing_area = gtk_drawing_area_new (); gtk_widget_set_size_request (drawing_area, 320, 240); g_object_set (drawing_area, "has-tooltip", TRUE, NULL); - g_signal_connect (drawing_area, "expose_event", - G_CALLBACK (drawing_area_expose), NULL); + g_signal_connect (drawing_area, "draw", + G_CALLBACK (drawing_area_draw), NULL); g_signal_connect (drawing_area, "query-tooltip", G_CALLBACK (query_tooltip_drawing_area_cb), NULL); gtk_box_pack_start (GTK_BOX (box), drawing_area, FALSE, FALSE, 2); |