|
From: | Andreas Hoeschler |
Subject: | Re: Modal dialogs not supported yet? |
Date: | Tue, 10 Feb 2004 19:40:39 +0100 |
Hi,
Where do you get this exception? If you're handling it in something called "between" the -runModalForWindow: call and the function/method where you call -abortModal, you should, in theory, just propagate it.Some would claim that exception handlers should never do anything exceptpropagate an unrecognized exception. Unfortunately, that breaks down in many cases, so it gets messy. Yet another reason to not use exceptions for flow control. :) I'd suggest using -stopModal unless you really really need the -abortModal semantics.
It seems I do not understand the abortModel semantics intended in GNUstep. On OPENSTEP I learned to end a modal dialog with [NSApp abortModal] if the user pressed cancel. This should give NSRunAbortedResponse as the return value of the rumModalWithWindow: method.
Is there any reason why we shouldn't replace - (void)abortModal { if (_session == 0) {[NSException raise:NSAbortModalException format:@"abortModal called while not in a modal session"];
} [NSException raise:NSAbortModalException format:@"abortModal"]; } with - (void)abortModal { [self stopModalWithCode:NSRunAbortedResponse]; } in NSApplication.m? This at least gives me the behaviour I see on Cocoa. Regards, Andreas
[Prev in Thread] | Current Thread | [Next in Thread] |