On Tue, 29 Jul 2003, Christian Reis wrote:
> I didn't understand you fully. Even if it is a generic function, storing
> a list (or a hash if it becomes necessary) of IDs is safe, since IDs are
> unique globally across your application. Then check if the ID is in the
> list and remove it otherwise.
> 
> This does mean you need shared state between code that requires it,
> though (maybe use a central SignalManager that stores the state).

Yes, this would work but it complicates things.  I'm looking for a simple 
way to implement the functionality of connect_while_alive() in gtk 1.

> > connected and only call disconnect if it is.  Does a function to check if 
> > a handler is connected exist in the C api?
> 
> Not sure, check out the docs for GObject.

There is a g_signal_handler_is_connected() function, though theoretically
handler id's can be reused according to the g_signal_handler_disconnect()  
docs.  I doubt that it's a practical problem after looking at the current
implementation in gsignal.c (handler id's are obtained by incrementing a
global integer counter), so I'll probably wrap handler_is_connected() and
use that.

Thanks,

John
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to