#include <gtk/gtk.h>

void onClick(GtkWidget *button)
{
   gtk_widget_set_sensitive(button, FALSE);
   g_print("Clicked!\n");
   gtk_widget_set_sensitive(button, TRUE);
}

int main(int argc, char *argv[])
{
   gtk_init(&argc, &argv);

   GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_widget_show(window);

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

   GtkWidget *button = gtk_button_new_with_label("Click!");
   gtk_widget_show(button);

   g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(onClick), NULL);

   gtk_container_add(GTK_CONTAINER(window), button);

   gtk_main();

   return 0;
}
