aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-gui-utils.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-01-10 05:58:39 +0800
committerChris Toshok <toshok@src.gnome.org>2003-01-10 05:58:39 +0800
commit1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a (patch)
tree66c3d86ca167436c985c742e27b9dbc7c758e024 /e-util/e-gui-utils.c
parent3eb3183d858656f6cd1e627c5027b7d87c3e3021 (diff)
downloadgsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar.gz
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar.bz2
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar.lz
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar.xz
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.tar.zst
gsoc2013-evolution-1c3f1f0d684aa512e8a126d9e9c672ba10b05e0a.zip
change this to use GtkImage instead of GnomeCanvas.
2003-01-09 Chris Toshok <toshok@ximian.com> * e-gui-utils.c (e_create_image_widget): change this to use GtkImage instead of GnomeCanvas. svn path=/trunk/; revision=19373
Diffstat (limited to 'e-util/e-gui-utils.c')
-rw-r--r--e-util/e-gui-utils.c40
1 files changed, 11 insertions, 29 deletions
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 <glib.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkalignment.h>
-#include <libgnome/gnome-util.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+#include <gtk/gtkimage.h>
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;
}