[Gtk-sharp-list] SignalArgs and Application.Quit()
Dan Winship
danw@novell.com
Sun, 27 Mar 2005 09:31:53 -0500
On Sun, 2005-03-27 at 01:27 -0600, Eric Sowell wrote:
> static void Window_Delete (object obj, DeleteEventArgs args)
> {
> SignalArgs sa = (SignalArgs) args;
> Application.Quit ();
> sa.RetVal = true;
> }
The cast to SignalArgs is completely unnecessary; DeleteEventArgs is a
subclass of it, so you can revert to "args.RetVal" directly.
In most gtk signals that have a boolean return value (like most of the
signals with "Event" in their name), returning true (ie, setting
args.RetVal to true rather than its default of false) indicates "I've
fully handled this event and you can stop further processing". In the
specific case of window DeleteEvents, it's probably not actually
relevant.
-- Dan