diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-06-06 14:08:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-06-06 14:08:21 (GMT) |
commit | b5934203c1cb287eb46b07e866b54d1de240b87b (patch) | |
tree | 283fad2a6d4517b84985331e5234095c71c8734b /src/gtkext/support.c | |
parent | e72eea33b9967d4169d2c8ffcb4a9e85c4c3ee8c (diff) |
Used a treeview with icons to show all known symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@165 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/support.c')
-rw-r--r-- | src/gtkext/support.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/gtkext/support.c b/src/gtkext/support.c index 67e7605..4eab7fe 100644 --- a/src/gtkext/support.c +++ b/src/gtkext/support.c @@ -90,3 +90,68 @@ gchar *find_pixmap_file(const char *filename) return result; } + + +/****************************************************************************** +* * +* Paramètres : filename = nom de fichier seul comme indice. * +* * +* Description : Construit une image à partir d'un nom de fichier. * +* * +* Retour : Elément mis en place ou NULL en cas d'erreur. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *get_image_from_file(const char *filename) +{ + GtkWidget *result; /* Instance à retourner */ + gchar *fullname; /* Chemin d'accès complet */ + + fullname = find_pixmap_file(filename); + + if (fullname != NULL) + { + result = gtk_image_new_from_file(fullname); + g_free(fullname); + + gtk_widget_show(result); + + } + else result = NULL; + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : filename = nom de fichier seul comme indice. * +* * +* Description : Construit un tampon d'image à partir d'un nom de fichier. * +* * +* Retour : Elément mis en place ou NULL en cas d'erreur. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GdkPixbuf *get_pixbuf_from_file(const char *filename) +{ + GdkPixbuf *result; /* Instance à retourner */ + gchar *fullname; /* Chemin d'accès complet */ + + fullname = find_pixmap_file(filename); + + if (fullname != NULL) + { + result = gdk_pixbuf_new_from_file(fullname, NULL); + g_free(fullname); + } + else result = NULL; + + return result; + +} |