- /* Create a new file selection widget. */
- file_dialog = gtk_file_selection_new(FILENAME_DESCRIPTION);
-
- /* Connect the file dialog's OK button up to a handler. */
- gtk_signal_connect(
- GTK_OBJECT(GTK_FILE_SELECTION(file_dialog)->ok_button),
- "clicked", GTK_SIGNAL_FUNC(FileOpenDialog_OK), file_dialog);
-
- /*
- * Ensure that the file selection dialog box is destroyed when the user
- * clicks CANCEL.
- */
- gtk_signal_connect_object(
- GTK_OBJECT(GTK_FILE_SELECTION(file_dialog)->cancel_button),
- "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
- (gpointer) file_dialog);
-
- /* Show the dialog. */
- gtk_widget_show(GTK_WIDGET(file_dialog));
-
- /*
- * To have the main window of our application being unusable while
- * using the dialog.
- */
- gtk_window_set_modal(GTK_WINDOW(file_dialog), TRUE);