From 1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 9 Jan 2003 21:58:39 +0000 Subject: change this to use GtkImage instead of GnomeCanvas. 2003-01-09 Chris Toshok * e-gui-utils.c (e_create_image_widget): change this to use GtkImage instead of GnomeCanvas. svn path=/trunk/; revision=19373 --- e-util/e-gui-utils.c | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) (limited to 'e-util/e-gui-utils.c') diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c index b7be21a6d9..892f97a064 100644 --- a/e-util/e-gui-utils.c +++ b/e-util/e-gui-utils.c @@ -13,53 +13,35 @@ #include "e-gui-utils.h" #include -#include -#include -#include -#include -#include +#include GtkWidget *e_create_image_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { char *filename; - GdkPixbuf *pixbuf; - double width, height; - GtkWidget *canvas, *alignment; + GtkWidget *alignment = NULL; if (string1) { + GtkWidget *w; + if (*string1 == '/') filename = g_strdup(string1); else - filename = g_concat_dir_and_file(EVOLUTION_IMAGES, string1); - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - width = gdk_pixbuf_get_width(pixbuf); - height = gdk_pixbuf_get_height(pixbuf); + filename = g_build_filename (EVOLUTION_IMAGES, string1, NULL); - canvas = gnome_canvas_new_aa(); - GTK_OBJECT_UNSET_FLAGS(GTK_WIDGET(canvas), GTK_CAN_FOCUS); - gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas)), - gnome_canvas_pixbuf_get_type(), - "pixbuf", pixbuf, - NULL); + w = gtk_image_new_from_file (filename); alignment = gtk_widget_new(gtk_alignment_get_type(), - "child", canvas, + "child", w, "xalign", (double) 0, "yalign", (double) 0, "xscale", (double) 0, "yscale", (double) 0, NULL); - - gtk_widget_set_usize(canvas, width, height); - - gdk_pixbuf_unref(pixbuf); - gtk_widget_show(canvas); - gtk_widget_show(alignment); - g_free(filename); + gtk_widget_show_all (alignment); + g_free (filename); + } - return alignment; - } else - return NULL; + return alignment; } -- cgit