|
From: | Fred Kiefer |
Subject: | Re: Modal dialogs not supported yet? |
Date: | Tue, 10 Feb 2004 00:01:54 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 |
Andreas Hoeschler wrote:
I run a modal dialog as follows. if ([NSApp runModalForWindow:panel] == NSRunStoppedResponse) { ... }When I click on the cancel button in the modal dialog which calls [NSApp abortModal] I get a "Abort Modal" exception. I looked into NSApplication.m and found/* * Running modal event loops */ - (void) abortModal { if (_session == 0) { [NSException raise: NSAbortModalException format: @"abortModal called while not in a modal session"]; } [NSException raise: NSAbortModalException format: @"abortModal"]; }This method always raises an exception. Are modal dialogs not supported yet? What am I missing?
The current code looks like a bug to me as this wont stop a modal loop, when executed from another thread. But than again your code would also not work if GNUstep had it correctly, as then we would than return NSRunAbortedResponse, a case you don't check for. Also the cancle button should rather call stopModal than abortModal. Still we need to fix this code. Any suggestions? I cannot see what would be wrong with a line like:
_session->runState = NSRunAbortedResponse;
[Prev in Thread] | Current Thread | [Next in Thread] |