diff options
author | Benjamin Otte <otte@redhat.com> | 2010-09-08 22:17:48 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:11:40 +0200 |
commit | 0ad2f57332dabdea6f1f59aae264823639202ce0 (patch) | |
tree | 78d308407bfcc65ceada15377eab6a77ef7d58e1 /tests/testellipsise.c | |
parent | 9c980372d27f79423f2c07c7a3203ec0db5c1749 (diff) | |
download | gtk+-0ad2f57332dabdea6f1f59aae264823639202ce0.tar.gz |
tests: Connect to draw signal in testellipsise
The test seems broken, not sure why.
Diffstat (limited to 'tests/testellipsise.c')
-rw-r--r-- | tests/testellipsise.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/testellipsise.c b/tests/testellipsise.c index 1020456479..e4d2b8c9e2 100644 --- a/tests/testellipsise.c +++ b/tests/testellipsise.c @@ -64,27 +64,22 @@ scale_changed_cb (GtkRange *range, } static gboolean -ebox_expose_event_cb (GtkWidget *widget, - GdkEventExpose *event, - gpointer data) +ebox_draw_cb (GtkWidget *widget, + cairo_t *cr, + gpointer data) { PangoLayout *layout; const double dashes[] = { 6, 18 }; - GtkAllocation allocation, label_allocation; + GtkAllocation label_allocation; GtkRequisition minimum_size, natural_size; GtkWidget *label = data; - cairo_t *cr; gint x, y; - cr = gdk_cairo_create (gtk_widget_get_window (widget)); cairo_translate (cr, -0.5, -0.5); cairo_set_line_width (cr, 1); - gtk_widget_get_allocation (widget, &allocation); - cairo_set_source_rgb (cr, 1, 1, 1); - cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); - cairo_fill (cr); + cairo_paint (cr); gtk_widget_translate_coordinates (label, widget, 0, 0, &x, &y); layout = gtk_widget_create_pango_layout (widget, ""); @@ -123,8 +118,6 @@ ebox_expose_event_cb (GtkWidget *widget, cairo_set_dash (cr, dashes, 2, 12.5); cairo_stroke (cr); - cairo_destroy (cr); - return FALSE; } @@ -169,7 +162,7 @@ main (int argc, char *argv[]) g_signal_connect (combo, "changed", G_CALLBACK (combo_changed_cb), label); g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed_cb), label); - g_signal_connect (ebox, "expose-event", G_CALLBACK (ebox_expose_event_cb), label); + g_signal_connect (ebox, "draw", G_CALLBACK (ebox_draw_cb), label); gtk_widget_show_all (window); |