Re: Dismissing Open dlog before doc actually opens
Re: Dismissing Open dlog before doc actually opens
- Subject: Re: Dismissing Open dlog before doc actually opens
- From: Uli Kusterer <email@hidden>
- Date: Wed, 14 Aug 2013 11:14:58 +0200
On Aug 14, 2013, at 7:51, Graham Cox <email@hidden> wrote:
> On 14/08/2013, at 1:38 AM, Steve Mills <email@hidden> wrote:
>>> unning an open panel modally is a user-hostile experience that prevents
>>> the user from interacting with other documents. OS X applications should
>>> not behave this way.
>>
>> Apple didn't feel that way in the past, so I don't believe it's user-hostile.
>
> They did, which is why first modeless dialogs (from System 1? 2?) and then sheets (OSX 1.0) were developed. Even as far back as the original Inside Macintosh the use of modal dialogs was strongly discouraged when it was possible to use something else. The original system design used a modal Open dialog but this became a modeless dialog in System 7 (1991), if I recall correctly.
A modeless dialog* would be a plain old window. :-p I presume you’re thinking of semi-modal dialogs, which only block the current application, can be dragged around, and were introduced with System 7.0 (so over 20 years ago). Well, the window border style for them was introduced then, and ModalDialog() was extended to handle them … there were some developers who just used a regular window and added an inset line in the body to fake them a little before that. OSX only has semi-modal dialogs, real modal dialogs that can’t be dragged and block all applications don’t seem to exist anymore in this real multi-tasking OS.
> Anyway, history aside, the fact that orderOut: doesn't do anything suggests a problem somewhere - I've seen this happen before when an unhandled exception during the modal loop puts it into a state where the modal session can't be closed and the dialog won't go away.
I vaguely remember having the same issue where an open panel stayed open too long. I think it might be related to autorelease pools holding on to the actual window-owning object (some private thing, I think). You might want to try creating an inner pool and releasing that right when you want the panel to close.
Also keep in mind that in current MacOS X releases, open and save panels are out-of-process windows managed by PowerBox (think sandbox), and NSOpenPanel and NSSavePanel are only proxy objects in your process. Many actions you had on NSWindow are probably stubbed out, and the remaining ones send messages to PowerBox to manipulate the actual window there, or to manage the little transparent, borderless window that holds your accessory view. orderOut: may be one of those.
Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere..."
*) Strictly speaking, in Classic there could have been a modeless dialog: A window created from a DLOG resource, then used as a regular window, run using DialogSelect(). But they weren’t really a ‘thing’ as a UI element. Usually they were just a shorthand for loading controls into a window, or were implemented as semi-modal.
_______________________________________________
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