12 #include <gdk-pixbuf/gdk-pixbuf.h>
20 #include "xgamelist.h"
22 #include "xedittags.h"
27 # define _(s) gettext (s)
28 # define N_(s) gettext_noop (s)
34 extern GtkWidget *GUI_Window;
37 GdkPixbuf *load_pixbuf(char *filename,int size)
42 image = gdk_pixbuf_new_from_file_at_size(filename,size,size,NULL);
44 image = gdk_pixbuf_new_from_file(filename,NULL);
48 fprintf(stderr,_("Error: couldn't load file: %s\n"),filename);
55 FileNamePopUp(label, def, proc, openMode)
62 * implement look for certain file types
63 * use save/load button depending on what function is calling
68 dialog = gtk_file_chooser_dialog_new (label,
69 GTK_WINDOW(GUI_Window),
70 GTK_FILE_CHOOSER_ACTION_OPEN,
71 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
72 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
74 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
79 filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
82 f = fopen(filename, openMode);
85 DisplayError(_("Failed to open file"), errno);
90 (*proc)(f, 0, filename);
95 gtk_widget_destroy (dialog);