1 USING: alien.c-types alien.data alien.strings alien.syntax
2 destructors file-picker gobject-introspection.standard-types
3 gtk.ffi io.encodings.string io.encodings.utf8 kernel system ;
10 FUNCTION: GtkWidget* gtk_file_chooser_dialog_new (
13 GtkFileChooserAction action,
14 gchar* first_button_text,
15 gint* first_button_response,
16 gchar* second_button_text,
17 gint* second_button_response,
20 : <gtk-file-chooser-dialog> ( title action -- dialog )
24 GTK_FILE_CHOOSER_ACTION_OPEN
26 GTK_RESPONSE_CANCEL int <ref>
29 GTK_RESPONSE_ACCEPT int <ref>
31 gtk_file_chooser_dialog_new
35 : run-and-get-filename ( dialog -- path/f )
36 dup gtk_dialog_run GTK_RESPONSE_ACCEPT = [
37 gtk_file_chooser_get_filename alien>native-string
44 M: linux open-file-dialog
46 "Open File" "Open" <gtk-file-chooser-dialog>
50 M: linux save-file-dialog
52 "Save File" "Save" <gtk-file-chooser-dialog>
53 dup t gtk_file_chooser_set_do_overwrite_confirmation
54 dup rot gtk_file_chooser_set_filename drop