aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-gui-utils.c
blob: 892f97a064abc34e167c44ca92f31d059c1e6c68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * GUI utility functions
 *
 * Author:
 *   Miguel de Icaza (miguel@ximian.com)
 *
 * (C) 1999 Miguel de Icaza
 * (C) 2000 Ximian, Inc.
 */
#include <config.h>

#include "e-gui-utils.h"

#include <glib.h>
#include <gtk/gtkimage.h>

GtkWidget *e_create_image_widget(gchar *name,
                 gchar *string1, gchar *string2,
                 gint int1, gint int2)
{
    char *filename;
    GtkWidget *alignment = NULL;
    if (string1) {
        GtkWidget *w;

        if (*string1 == '/')
            filename = g_strdup(string1);
        else
            filename = g_build_filename (EVOLUTION_IMAGES, string1, NULL);

        w = gtk_image_new_from_file (filename);

        alignment = gtk_widget_new(gtk_alignment_get_type(),
                       "child", w,
                       "xalign", (double) 0,
                       "yalign", (double) 0,
                       "xscale", (double) 0,
                       "yscale", (double) 0,
                       NULL);

        gtk_widget_show_all (alignment);
        g_free (filename);
    }

    return alignment;
}