#include <gtk/gtk.h>

  GtkWidget *window;
  GtkWidget *button;

static gboolean button_cb( GtkWidget *widget,
                          GdkEvent *event)
{
  gtk_widget_set_sensitive (button, FALSE);
  sleep(4);
  gtk_widget_set_sensitive (button, TRUE);
  return TRUE;
}

int main( int argc,
          char *argv[] )
{
  GtkWidget *main_vbox;

  gtk_init (&argc, &argv);
 
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW(window), "Button Frame");
  gtk_widget_set_size_request (GTK_WIDGET(window), 400, 400);

  main_vbox = gtk_vbox_new (FALSE, 1);
  gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
  gtk_container_add (GTK_CONTAINER (window), main_vbox);
 
  button = gtk_button_new_with_label ("button");
  g_signal_connect (G_OBJECT(button),
                     "clicked",
                     G_CALLBACK(button_cb),
                     (gpointer) window);
  gtk_box_pack_end (GTK_BOX (main_vbox), button, FALSE, TRUE, 0);

  gtk_widget_show_all (window);
  gtk_window_present (GTK_WINDOW(window));

  gtk_main ();
 
  return 0;
}
