summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/pixbufs.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-08 21:53:26 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:40 +0200
commit9ef1dfc0a30b215f3df7ad35638cf306367d8979 (patch)
treed00af28854d432371188c3cd9a609480fe1b619a /demos/gtk-demo/pixbufs.c
parentef56ba83f8f1d2e1a3f76bc98baf592195a15c10 (diff)
downloadgtk+-9ef1dfc0a30b215f3df7ad35638cf306367d8979.tar.gz
gtk-demo: Connect to draw signal in pixbufs example
Diffstat (limited to 'demos/gtk-demo/pixbufs.c')
-rw-r--r--demos/gtk-demo/pixbufs.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/demos/gtk-demo/pixbufs.c b/demos/gtk-demo/pixbufs.c
index e2fbcb06a5..0095790e45 100644
--- a/demos/gtk-demo/pixbufs.c
+++ b/demos/gtk-demo/pixbufs.c
@@ -96,19 +96,12 @@ load_pixbufs (GError **error)
/* Expose callback for the drawing area */
static gint
-expose_cb (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer data)
+draw_cb (GtkWidget *widget,
+ cairo_t *cr,
+ gpointer data)
{
- cairo_t *cr;
-
- cr = gdk_cairo_create (event->window);
-
gdk_cairo_set_source_pixbuf (cr, frame, 0, 0);
- gdk_cairo_rectangle (cr, &event->area);
- cairo_fill (cr);
-
- cairo_destroy (cr);
+ cairo_paint (cr);
return TRUE;
}
@@ -246,8 +239,8 @@ do_pixbufs (GtkWidget *do_widget)
da = gtk_drawing_area_new ();
- g_signal_connect (da, "expose-event",
- G_CALLBACK (expose_cb), NULL);
+ g_signal_connect (da, "draw",
+ G_CALLBACK (draw_cb), NULL);
gtk_container_add (GTK_CONTAINER (window), da);