[pygtk] repetitive get_widget() using Glade?

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Thu Aug 12 05:18:44 WST 2004


A Qua, 2004-08-11 às 21:31, Skip Montanaro escreveu:
>     >> How do I convince Glade to create new Window and TextView widgets on
>     >> subsequent calls to get_widget()?
> 
>     Johan> Two possible solutions:
> 
>     Johan> 1) Don't destroy the window, just hide it.
> 
> But when the user pokes the "x" won't the underlying X windows be destroyed?
> Is there a way to catch the destroy signal and avoid the window destruction?
> I'd happily just hide the window, but that doesn't seem to work either.
> 
>     Johan> 2) Call glade.XML again to reparse (and recreate all widgets)
> 
> Sounds expensive. :-(

  No, it is not.  libglade automatically caches XML trees, so only the
first time is the XML file really opened and parsed.  Subsequent
invocations with same parameters merely construct the widget tree from
the description in memory.

> 
> Thanks for the ideas...
> 
> Skip
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic



More information about the pygtk mailing list