[gtk+/rendering-cleanup-next: 127/154] tests: Use draw signal in testinput
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 127/154] tests: Use draw signal in testinput
- Date: Tue, 14 Sep 2010 15:57:21 +0000 (UTC)
commit 01c6255769731ed4549843218f972ed9efa1d455
Author: Benjamin Otte <otte redhat com>
Date: Thu Sep 9 01:16:28 2010 +0200
tests: Use draw signal in testinput
tests/testinput.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/tests/testinput.c b/tests/testinput.c
index aecdb5b..5d353bd 100644
--- a/tests/testinput.c
+++ b/tests/testinput.c
@@ -104,16 +104,11 @@ configure_event (GtkWidget *widget, GdkEventConfigure *event)
}
/* Refill the screen from the backing surface */
-static gint
-expose_event (GtkWidget *widget, GdkEventExpose *event)
+static gboolean
+draw (GtkWidget *widget, cairo_t *cr)
{
- cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
cairo_set_source_surface (cr, surface, 0, 0);
- gdk_cairo_region (cr, event->region);
- cairo_fill (cr);
-
- cairo_destroy (cr);
+ cairo_paint (cr);
return FALSE;
}
@@ -325,8 +320,8 @@ main (int argc, char *argv[])
/* Signals used to handle backing surface */
- g_signal_connect (drawing_area, "expose_event",
- G_CALLBACK (expose_event), NULL);
+ g_signal_connect (drawing_area, "draw",
+ G_CALLBACK (draw), NULL);
g_signal_connect (drawing_area, "configure_event",
G_CALLBACK (configure_event), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]