[gtk+/rendering-cleanup-next: 110/199] gtk-demo: Connect to draw signal in pixbufs example



commit 0400bf0cff67bef5ddd198a5ad4d940a346ceede
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 |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/demos/gtk-demo/pixbufs.c b/demos/gtk-demo/pixbufs.c
index e2fbcb0..0095790 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]