#include <stdlib.h>
#include <gtk/gtk.h>

int x(gpointer fc)
{
    char* fn = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fc));
    if (fn!=NULL) printf("%s\n",fn);
    return 1;
}

int main(int argc, char* argv[])
{
    gtk_init(&argc, &argv);
 
    GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    g_signal_connect(window, "destroy", G_CALLBACK (gtk_main_quit), NULL);

    GtkWidget* fc = gtk_file_chooser_button_new("fc", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);

    gtk_container_add(GTK_CONTAINER(window), fc);

    gtk_widget_show_all(window);

    g_timeout_add(200, (x), fc);

    gtk_main();
    return 0;
}
