[gtk+/refactor: 128/138] demos/testpixbuf-scale.c: Use accessor functions to access GtkWidget
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 128/138] demos/testpixbuf-scale.c: Use accessor functions to access GtkWidget
- Date: Mon, 16 Aug 2010 06:20:12 +0000 (UTC)
commit 8581d28f9e96c2cf15070300b287345d294c74b0
Author: Javier Jardón <jjardon gnome org>
Date: Mon Aug 16 00:36:11 2010 +0200
demos/testpixbuf-scale.c: Use accessor functions to access GtkWidget
demos/testpixbuf-scale.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c
index 6d335e1..50244e4 100644
--- a/demos/testpixbuf-scale.c
+++ b/demos/testpixbuf-scale.c
@@ -34,18 +34,21 @@ overall_changed_cb (GtkAdjustment *adjustment, gpointer data)
gboolean
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
+ GtkAllocation allocation;
GdkPixbuf *dest;
cairo_t *cr;
- gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
-
+ gdk_window_set_back_pixmap (gtk_widget_get_window (widget),
+ NULL, FALSE);
+
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
+ gtk_widget_get_allocation (widget, &allocation);
gdk_pixbuf_composite_color (pixbuf, dest,
0, 0, event->area.width, event->area.height,
-event->area.x, -event->area.y,
- (double) widget->allocation.width / gdk_pixbuf_get_width (pixbuf),
- (double) widget->allocation.height / gdk_pixbuf_get_height (pixbuf),
+ (double) allocation.width / gdk_pixbuf_get_width (pixbuf),
+ (double) allocation.height / gdk_pixbuf_get_height (pixbuf),
interp_type, overall_alpha,
event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]