#include "gst_fs.h" /* Pour ne permettre qu'un file-selection à la fois */ static int fs_ouvert = 0; void file_close (GtkWidget *w, GtkFileSelection *fs) { fs_ouvert = 0; gtk_widget_destroy (GTK_WIDGET (fs)); } void fs_open (GtkWidget *widget, type_ok_fct ok_fct) { GtkWidget *filew; if (fs_ouvert > 0) return; fs_ouvert = 1; /* Create a new file selection widget */ filew = gtk_file_selection_new ("Choix du fichier"); /* Connect the ok_button to file_ok_sel function */ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", (GtkSignalFunc) ok_fct, filew ); gtk_signal_connect (GTK_OBJECT (filew), "destroy", (GtkSignalFunc) file_close, filew); /* Connect the cancel_button to destroy the widget */ gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", (GtkSignalFunc) file_close, filew); gtk_widget_show(filew); }