Re: [gtk-list] Re: closing windows



On Mon, 28 Jun 1999, Havoc Pennington wrote:

> 
> On Mon, 28 Jun 1999, Brett Kosinski wrote:
> > 
> > You can attach two signals to an object, so with your okay button, you
> > would attach, as the SECOND signal, the window destroy code you have
> > attached to the Cancel button.  Now, remember, make the window destruction
> > signal the SECOND one, since if you don't, funky things can happen (since
> > your okay button is destroyed prior to other signals being called).
> > 
> 
> There is no guarantee that signals are called in the order of attachment.
> (Yes, they are in the current implementation, but technically speaking
> this is mere coincidence.)

actually we do guarrantee that signal handlers get called in the order they
got connected (modulo connect vs. connect_after). there's a bunch of code
relying on that, and stopping of signal emissions (or blocking of handlers)
couldn't be used in a reliable way otherwise.

> You should at least use a connect() and a
> connect_after() to ensure ordering, but using a single callback that
> destroys the window as part of its functionality is far, far cleaner.
> 
> See my sample chapters for details on connect and connect_after:
> http://pobox.com/~hp/gnome-app-devel.html
> 
> Havoc
> 

---
ciaoTJ




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