#include <gtk/gtk.h>

static void
button_clicked_cb(GtkButton *button, gpointer data)
{
    GtkWidget *window2;
    window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_show_all(window2);
    gtk_widget_hide(window2);
    gtk_widget_show(window2);
}

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

    gtk_init(&argc, &argv);

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

    button = gtk_button_new_with_label("Click me");
    g_signal_connect(G_OBJECT(button), "clicked",
                     G_CALLBACK(button_clicked_cb), NULL);
    gtk_container_add(GTK_CONTAINER(window), button);

    gtk_widget_show_all(window);
    gtk_widget_hide(window);
    gtk_widget_show(window);

    gtk_main();

    return 0;
}
