[gtk+/rendering-cleanup-next: 109/153] gtk-demo: Connect to draw signal in pixbufs example
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 109/153] gtk-demo: Connect to draw signal in pixbufs example
- Date: Sat, 11 Sep 2010 05:00:35 +0000 (UTC)
commit d6a9c5a104b2579c8052bbb15ac5af29b35883b2
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 8 21:53:26 2010 +0200
gtk-demo: Connect to draw signal in pixbufs example
demos/gtk-demo/pixbufs.c | 21 ++++++++-------------
1 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/demos/gtk-demo/pixbufs.c b/demos/gtk-demo/pixbufs.c
index e2fbcb0..9c4a6ec 100644
--- a/demos/gtk-demo/pixbufs.c
+++ b/demos/gtk-demo/pixbufs.c
@@ -96,19 +96,14 @@ 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,
+ int width,
+ int height,
+ 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 +241,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]