#include <gtk/gtk.h>

static gboolean toggle (gpointer button)
{
  g_object_set (button, "active", !gtk_toggle_button_get_active (button), NULL);
  return TRUE;
}

int
main (int argc, char **argv)
{
  GtkWidget *window, *vbox, *button;
  
  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);

  vbox = gtk_vbox_new (FALSE, 6);
  gtk_container_add (GTK_CONTAINER (window), vbox);

  button = gtk_check_button_new_with_label ("Check me first!");
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
  gtk_widget_set_sensitive (button, FALSE);
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);

  button = gtk_check_button_new_with_label ("Check me next!");
  gtk_widget_set_sensitive (button, FALSE);
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);

  button = gtk_check_button_new_with_label ("Check me first!");
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
  gtk_widget_set_sensitive (button, FALSE);
  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);

  g_timeout_add (2000, toggle, button);

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

  gtk_main ();
  return 0;
}
