#include <gtk/gtk.h>

static gboolean
replace_window (gpointer user_data)
{
  static GtkWidget *window = NULL;

  if (window != NULL)
    {
      gtk_widget_destroy (window);
      window = NULL;
    }

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size ((GtkWindow *)window, 320, 240);
  gtk_widget_show_all (window);

  return TRUE;
}

int main (int argc,char **argv)
{
  gtk_init (&argc, &argv);

  g_timeout_add (100, &replace_window, NULL);

  gtk_main ();
  return 0;
}
