On Thu, Jun 03, 2004 at 04:47:41PM -0400, Steve McClure wrote:
> I'm trying to save the column sizes when my app exits and restore them
> when the app starts again. I started by using the resize_column signal
> but apparently that signal isn't generated when the right most column is
> resized. I have my CList in a ScrolledWindow so it is possible to do
> that but the event isn't generated. Am I doing something wrong, or is
> there some way around this?
Hmmm. No idea what's wrong here, but it could just be a GTK+ issue (and
the right-most column is notoriously confusing when resizing autowidth
lists, which further complicates things). I'd suggest just capturing
sizes "periodically" or on application exit (god forbid crashes)
> A second question, while messing with this I decided I would just
> capture the column sizes when the app exits instead of doing it while
> the user is interacting with the app. However, I don't get a destroy
> event on the CList widget if the widget isn't mapped and I never get
> unmap or unrealize on the widget. Any insight into to that is
> appreciated.
Well, I'd suggest you just do it explicitly in your application exit
handler (after mainquit is called, for instance).
In my experiments, it seems that a lone CList does get at least
unrealize when it's window is closed (unmap and unmap_event didn't fire):
>>> def foo(*a):
... print "Unrealized", a
>>> w = gtk.GtkWindow()
>>> c = gtk.GtkCList()
>>> w.add(c)
>>> w.show_all()
>>> c.connect("unrealize", foo)
10
At this point I close the window, and:
>>> Unrealized (<gtk.GtkCList instance at 0x402c55ac>,)
It could be that the ScrolledWindow around the CList makes a difference,
though I find that unlikely.
Note that unrealize needs the mainloop to be triggered -- if the
mainloop is already gone, no event will be triggered. I'd suggest not
relying on signals and just doing it explicitly on your application
shutdown facility (you do have an application shutdown facility, right?
<wink>)
Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/