#include <gtk/gtk.h>

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

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (window, "destroy", gtk_main_quit, NULL);

  button = gtk_toggle_button_new_with_label ("Show/hide other window");
  gtk_container_add (GTK_CONTAINER (window), button);

  popup_window = gtk_window_new (GTK_WINDOW_POPUP);
  label = gtk_label_new ("Can you see me?");
  gtk_container_add (GTK_CONTAINER (popup_window), label);
  gtk_widget_show (label);

  g_object_bind_property (button, "active",
                          popup_window, "visible",
                          G_BINDING_DEFAULT);

  gtk_widget_show_all (window);

  gtk_main ();
  return 0;
}
