From 6a28e7b16404b6481496b763bc60b47cbae21bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Mon, 16 Aug 2010 00:37:58 +0200 Subject: [PATCH] demos/gtk-demo/colorsel.c: Use accessor functions to access GtkWidget --- demos/gtk-demo/colorsel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c index bb7c978796..61bdbbf615 100644 --- a/demos/gtk-demo/colorsel.c +++ b/demos/gtk-demo/colorsel.c @@ -19,14 +19,17 @@ expose_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data) { - if (widget->window) + GdkWindow *window; + + window = gtk_widget_get_window (widget); + if (window) { GtkStyle *style; cairo_t *cr; style = gtk_widget_get_style (widget); - cr = gdk_cairo_create (widget->window); + cr = gdk_cairo_create (window); gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]); gdk_cairo_rectangle (cr, &event->area);