#include <gtk/gtk.h>



GtkWidget *dialog;


static gboolean
hide_dialog ()
{

  gtk_widget_destroy (dialog);

  return G_SOURCE_REMOVE;
}



void
main (int argc, char **argv)
{
  gtk_init (&argc, &argv);
  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
             dialog = gtk_dialog_new ();

  gtk_window_set_transient_for ((GtkWindow *)dialog, (GtkWindow *)window);
  gtk_window_set_modal ((GtkWindow *)dialog, TRUE);
  gtk_window_set_attached_to ((GtkWindow *)dialog, window);

  gtk_window_resize ((GtkWindow *)dialog, 200, 200);

  g_timeout_add (5000, hide_dialog, NULL);


  gtk_window_resize ((GtkWindow *)window, 400, 400);
  gtk_widget_show_all (window);
  gtk_widget_show (dialog);
  gtk_main ();
}
