Re: Showing another sheet in openPanelDidEnd
Re: Showing another sheet in openPanelDidEnd
- Subject: Re: Showing another sheet in openPanelDidEnd
- From: Ken Thomases <email@hidden>
- Date: Tue, 29 Jul 2008 19:20:33 -0500
On Jul 29, 2008, at 7:11 PM, Kenny Carruthers wrote:
Does anyone know why any attempts to show a second sheet
immediately after an NSOpenPanel has been dismissed causes the
parent window to disappear?
The user flow is as follows:
- Show Import Window
- Show NSOpenPanel via [panel beginSheetForDirectory...]
(Panel is properly displayed)
- User either accepts or cancels the file panel
- My openPanelDidEnd method is properly called with the correct
result from the File Panel
- If I now try showing a new sheet, my main Import Window will hide
and I'll be left with just my new sheet on the screen.
If I skip the File Panel operation, then my sheet is correctly
shown, so that's working properly. Since the File Panel is not
completely dismissed inside openPanelDidEnd I wonder if something
weird isn't going on with [NSApp beginSheet...] whereby it can't
show the new sheet because the File Panel is still being "rolled up"
inside openPanelDidEnd. NSApp appears to be smart enough to not let
you show to sheets on one window, I get a system beep when trying to
do that, but maybe it's confused here because the File Panel has
been dismissed but is still be animated while my code executes to
show the second sheet. Maybe there's a way to know when the File
Panel has been full dismissed?
Thoughts?
Did you explicitly close the first sheet in your did-end method,
before attempting to show the second sheet? You have to do that
yourself. It isn't automatically closing for you.
See this: http://developer.apple.com/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCascadingSheets.html
Cheers,
Ken
_______________________________________________
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