Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FileChooser(GtkWidget *widget, ChData *data)
- {
- GtkWidget *dialog;
- GtkFileChooser *chooser;
- GtkFileChooserAction action;
- gchar *filename;
- gint res;
- action = GTK_FILE_CHOOSER_ACTION_OPEN;
- dialog = gtk_file_chooser_dialog_new("Open File",
- GTK_WINDOW(data->MainWindow),
- action,
- "_Cancel",
- GTK_RESPONSE_CANCEL,
- "_Open",
- GTK_RESPONSE_ACCEPT,
- NULL);
- res = gtk_dialog_run(GTK_DIALOG(dialog));
- if (res == GTK_RESPONSE_ACCEPT)
- {
- chooser = GTK_FILE_CHOOSER(dialog);
- gtk_file_chooser_set_select_multiple (chooser, TRUE);
- filename = gtk_file_chooser_get_filename(chooser);
- g_free(filename);
- }
- gtk_widget_destroy(dialog);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement