#include <gtk/gtk.h>

static void response_cb (GtkWidget *dialog, int response)
{
	gtk_widget_destroy (dialog);

	g_timeout_add (2 * 5000, (GSourceFunc) gtk_main_quit, NULL);
}

int
main (int argc, char **argv)
{
	GtkWidget      *chooser;
	GtkWindowGroup *group;

	gtk_init (&argc, &argv);

	chooser = gtk_file_chooser_dialog_new ("Foo", NULL,
			GTK_FILE_CHOOSER_ACTION_OPEN,
			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
			NULL);
	g_signal_connect (chooser, "response", G_CALLBACK (response_cb), NULL);
	gtk_widget_show (chooser);

	group = gtk_window_group_new ();
	gtk_window_group_add_window (group, GTK_WINDOW (chooser));
	g_object_unref (group);

	gtk_main ();

	return 0;
}
