Re: [gtk-list] Re: closing windows




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.) 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




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