Modal window won't go away when stopped
Modal window won't go away when stopped
- Subject: Modal window won't go away when stopped
- From: Randall Meadows <email@hidden>
- Date: Wed, 30 Jul 2008 19:00:40 -0600
OK, here's an interesting one...
I invoke [NSApp runModalForWindow:confirmDeletionWdw] from an IBAction
(call it MethodA) of a popup menu item displayed in a sheet.
That modal window has a button, in whose IBAction (call it MethodB) I
call [NSApp stopModalWithCode:[sender tag]].
The modal loop ends, control returns to my MethodA (with the
appropriate return code), and my app continues on. However, the modal
window is *still* displayed on screen. It's no longer modal; I can
click back in my original sheet, and interact with it, etc. I can
also still interact with the no-longer-modal modal window, and the
buttons' actions are triggered.
I was under the impression that, having displayed and started a modal
window loop with runModalForWindow:, that stopModalWithCode: would
stop the modal loop and close (or at least hide) the window. The docs
say that "This method stops the loop only if it’s executed by code
responding to an event", which I'm doing as part of the IBAction
assigned to the button, no?
Any ideas on what I'm supposed to do to get this modal window to
disappear when the modal loop is over?
Tank ewe!
randy
PS - In case anyone's wondering, I'm using the modal window because
the action the user is about to do is being confirmed, in a very
noticeable way, since the action is about to delete files. I'm NOT
using a sheet for this, since the action is already being requested
*from* a sheet, and said sheet is *already* part of a *series* of
sheets. The modal window simply seemed the best route to go._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden