/* gcc hideme.c -o hideme `pkg-config gtk+-2.0 --cflags --libs` */ #include static void hide( GtkWidget *widget, gpointer data) { gtk_window_iconify (GTK_WINDOW (data)); } static void destroy(GtkWidget *widget, gpointer data) { gtk_main_quit (); } int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 10); button = gtk_button_new_with_label ("Iconify"); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_show_all (window); g_signal_connect (window, "destroy", G_CALLBACK (destroy), NULL); g_signal_connect (button, "clicked", G_CALLBACK (hide), window); gtk_main (); return 0; }