[Glade-users] Best practice for destroying windows?

John Coppens john@jcoppens.com
Thu, 10 Jun 2004 14:36:36 -0300


On Wed, 09 Jun 2004 21:36:12 -0400
Jay Camp <jayc@CLEMSON.EDU> wrote:

> What is the best way to destroy a window?  Hiding (which seems to be the
> default?) would work, but then I have to write a function to reset all
> the settings back to their defaults.

Jay,

As I understand it - and use it, hiding a window shouldn't change anything
of its interior. With a show, it appears again, completely unchanged.

Destroy removes the widget from memory, and you have to
create_YourWindow() to create it again (if you use Glade). 'Instantiate'
in the sense of declaring it, isn't enough. You have to generate a
gtk_window_new after a destroy (and re-generate its contents)

John

> 
> I have tried doing gtk_widget_destroy() when catching the delete_event
> signal, but the next time I try to instantiate the window, it complains
> that it isn't a valid widget.
> 
> Am I missing something here?
> 
> Also, is there a way to have more than one copy of a window?  From what
> I understand, glade_xml_get_widget() always returns the same widget.
> 
> Thank you!
> 
> Jay
> 
> _______________________________________________
> Glade-users maillist  -  Glade-users@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users