/* Little example showing the "not activated" bug in gtk+ 1.2 and 1.3
   Please, send comments to llanero@jazzfree.com.
 */

#include <gtk/gtkbutton.h>

int active_button(gpointer foo)
{
	gtk_widget_set_sensitive((GtkWidget *)foo, 1);
	g_print("button activated!\n");
	return 0;
}

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

	gtk_init(&argc, &argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

	gtk_widget_set_usize(window, 400, 400);

	button = gtk_button_new_with_label("Hello!");
	
	gtk_container_add(window, button);

	gtk_widget_set_sensitive(button, 0);
	
	gtk_widget_show(button);
	gtk_widget_show(window);

	gtk_timeout_add(2000, active_button, button);
	
	gtk_main();

	return 0;
}