Re: Glade dialogs



On Sun, 2004-10-24 at 21:31, A. Pagaltzis wrote:
* Ross McFarland <rwmcfa1 neces com> [2004-10-24 23:58]:
so as you've now seen glade creates the widgets once (when you
load the glade data) and when you ask for the widget it just
keeps giving you the same one.

Without having done any homework myself, out of idle curiosity:
is there any way to change this behaviour?

not really. it's a side effect of the way that gladexml works. it puts
all of the widgets the xml specifies into a hash and then when you get
them out it just looks up the widget you want in the hash table (why you
can't have duplicate names without problems.) if you destroy that widget
then there's an invalid entry in that hash table. 

i suppose you could hook a destroy signal handler in to remove the
widget from the hash table and them maybe in some really hacky way
recreate it the second time around (when it's not in the hash anymore,
but that sounds like a really really bad idea and would require
substantial changes to gladexml which is pretty stable. not the least of
which would be keeping all of the glade data in memory after you were
done with it.

the workaround is either to reload the gladexml data each time you go to
use the dialog or to do as i mentioned before, just hide the widget. 

-- 
-rm
http://www.neces.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]