[Glade-users] Using Gtk2::GladeXML -- "reusing" popups

Christopher Cramer crayc@greatjustice.org
Thu, 11 Nov 2004 13:49:29 -0800


On Thu, Nov 11, 2004 at 07:08:55AM -0500, Big Perm wrote:
> Question 1.  This is the important one.  I don't know how to "reuse"
> the dialog box.  In other words, it's created from the XML file; I get
> the widget and access its signals, no problem.  But -- if the user
> closes (with the 'x') the box, I don't know how to restore it as it
> was.  It's not so much the values...I have those.  It's the layout of
> the box that I lose.

There are basically two approaches:

1. Load the dialog with glade_xml_new every time you need it
2. Hide the window instead of destroying it when you don't need it

> Question 2.  This is related to the first one...I chose to use a "Top
> Level" dialog box because when I chose "Popup" the box just appears
> right on top of my window, with no border or anything.  It looks
> horrible.  I'm not sure how to give it a border; I have specified a
> border of 5 and even 25 in Glade.

Just make it top level.

See:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Standard-Enumerations.html#GtkWindowType

-- 
Christopher Cramer <crayc@greatjustice.org>
On résiste à l'invasion des armées; on ne résiste pas à l'invasion
des idées. -- Victor Hugo