]> Pileus Git - ~andy/gtk/commitdiff
tests/testcairo.c: Use accessor functions to access GtkWidget
authorJavier Jardón <jjardon@gnome.org>
Sun, 15 Aug 2010 22:34:48 +0000 (00:34 +0200)
committerJavier Jardón <jjardon@gnome.org>
Sun, 22 Aug 2010 16:29:42 +0000 (18:29 +0200)
tests/testcairo.c

index b2a232b0265da6498c08287789c273c6aed6ebbb..dc3a27cfc26d4d48c26f278cdff5f374c961dff2 100644 (file)
@@ -195,11 +195,13 @@ on_expose_event (GtkWidget      *widget,
                 GdkEventExpose *event,
                 gpointer        data)
 {
+  GtkAllocation allocation;
   cairo_t *cr;
 
-  cr = gdk_cairo_create (widget->window);
+  cr = gdk_cairo_create (gtk_widget_get_window (widget));
 
-  draw (cr, widget->allocation.width, widget->allocation.height);
+  gtk_widget_get_allocation (widget, &allocation);
+  draw (cr, allocation.width, allocation.height);
 
   cairo_destroy (cr);