Disabled, because it makes the nightly builds fail quite often and it's already
[AROS-Contrib.git] / mui / gtk-mui / examples / filesel.c
blob8e26725ec503e6712946a75812be441fceb3c762
2 #include <gtk/gtk.h>
4 /* Get the selected filename and print it to the console */
5 void file_ok_sel( GtkWidget *w,
6 GtkFileSelection *fs )
8 g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
11 int main( int argc,
12 char *argv[] )
14 GtkWidget *filew;
16 gtk_init (&argc, &argv);
18 /* Create a new file selection widget */
19 filew = gtk_file_selection_new ("File selection");
21 g_signal_connect (G_OBJECT (filew), "destroy",
22 G_CALLBACK (gtk_main_quit), NULL);
23 /* Connect the ok_button to file_ok_sel function */
24 g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
25 "clicked", G_CALLBACK (file_ok_sel), (gpointer) filew);
27 /* Connect the cancel_button to destroy the widget */
28 g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
29 "clicked", G_CALLBACK (gtk_widget_destroy),
30 G_OBJECT (filew));
32 /* Lets set the filename, as if this were a save dialog, and we are giving
33 a default filename */
34 gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew),
35 "penguin.png");
37 gtk_widget_show (filew);
38 gtk_main ();
39 return 0;