[Haskell-cafe] Gtk2Hs, Glade, Multiple windows/dialog in one interface file.

D.V. dav.vire+haskell at gmail.com
Sun Jul 8 15:37:04 EDT 2007

Is it possible to have multiple windows in a glade file, and display
only one when the program starts, then show/hide the others as the
need arises ?

I can't find how...

I have a main window with a menu. One entry shows the about dialog
which is also defined in the glade file :
  aboutmenu   <- xmlGetWidget xml castToMenuItem "apropos1"
  onActivateLeaf aboutmenu $ do
    widgetShowAll aboutdialog

My problems are multiple :
1)  how do I handle the close button that is automatically generated ?
I tried doing this ...

  aboutdialog <- xmlGetWidget xml castToAboutDialog "aboutdialog1"
  onDestroy aboutdialog $ do
    widgetHide aboutdialog

But the Close button doesn't work, and if I close the about dialog by
the upper right cross button, it does disappear, but if I select again
the menuitem, then a tiny empty dialog opens, as if the about dialog
has been stripped out of all his inner components. And I get this line

(<interactive>:10852): Gtk-CRITICAL **: gtk_container_foreach:
assertion `GTK_IS_CONTAINER (container)' failed

I tried looking at the demos, but it doesn't help. The closest that
could have helped uses an about dialog it creates, instead of reading
from a glade file.

More information about the Haskell-Cafe mailing list