Re: gtkfilechooser buttons



Gyözö Both ha scritto lo scorso 17/06/2005 16:49:
You can consider using a dinamically generated filechooser, instead
of a statically generated one (i.e. that created by Glade) by means
of gtk_file_chooser_dialog_new; in this way, you can select a GTK_FILE_CHOOSER_ACTION_OPEN behaviour or a
GTK_FILE_CHOOSER_ACTION_SAVE one, depending on your current operation.


well, the behaviour of the widget is all right. but why doesn't the
button image change when i set to save mode? i mean, the folder
browser and the other parts of the window are ok.

shouldn't the appearance of the filechooser widget change when i set
the action with gtk_file_chooser_set_action ?


Mmh, no (sorry, I didn't read accurately your first question); all buttons in the GtkFileChooserDialog can be controlled as well from within the gtk_file_chooser_dialog_new function. Please, take a look at following examples:

dlg = gtk_file_chooser_dialog_new ("Save current project as...",
                                   GTK_WINDOW (parent),
                                   GTK_FILE_CHOOSER_ACTION_SAVE,
                                   GTK_STOCK_CANCEL,
                                   GTK_RESPONSE_CANCEL,
                                   GTK_STOCK_SAVE_AS,
                                   GTK_RESPONSE_ACCEPT,
                                   NULL);

dlg = gtk_file_chooser_dialog_new ("Open project file",
                                   GTK_WINDOW (parent),
                                   GTK_FILE_CHOOSER_ACTION_OPEN,
                                   GTK_STOCK_CANCEL,
                                   GTK_RESPONSE_CANCEL,
                                   GTK_STOCK_OPEN,
                                   GTK_RESPONSE_ACCEPT,
                                   NULL);

Cheers,
Carlo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]