gtkFileChooserDialogNew(title = NULL, parent = NULL, action, ..., show = TRUE)
gtkFileChooserDialogNewWithBackend(title = NULL, parent = NULL, action, backend, ..., show = TRUE)
gtkFileChooserDialog(title = NULL, parent = NULL, action, ..., backend, show = TRUE)
# This is how one creates a dialog with buttons and associated response codes. # (Please ignore the C "Response Code" example in the next section) dialog <- gtkFileChooserDialog("Open File", parent_window, "open", "gtk-cancel", GtkResponseType["cancel"], "gtk-open", GtkResponseType["accept"])
if (dialog$run() == GtkResponseType["accept"]) { filename <- dialog$getFilename() f <- file(filename) }
dialog$destroy()
gtkFileChooserDialogNew
as follows:
GtkWidget *dialog;dialog = gtk_file_chooser_dialog_new ("Open File",
parent_window,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
This will create buttons for "Cancel" and "Open" that use stock
response identifiers from GtkResponseType
. For most dialog
boxes you can use your own custom response codes rather than the
ones in GtkResponseType
, but
gtkFileChooserDialog
is the result of collapsing the constructors of GtkFileChooserDialog
(gtkFileChooserDialogNew
, gtkFileChooserDialogNewWithBackend
) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.