On Oct 7, 2009, at 3:12 PM, Kyle Sluder wrote:
FWIW, the alerts are run with beginModalSessionForWindow and runModalSession.So I don't understand why you're so intent on using NSAlert if you're not using its -beginSheetModalForWindow:… convenience method?
Oh, I use it. But because of the design of the rest of the application, the sheet still has to run as application modal.
The code handling both sheet and non-sheet alerts, both in application global mode, is about as follows:
if (useSheet) [dialog beginSheetModalForWindow:... didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) ...]; session = [NSApp beginModalSessionForWindow: [dialog window]]; NSInteger ret1 == -1, ret2 = -1; while (ret == -1 && ((ret2 = [NSApp runModalSession: session]) == NSRunContinuesResponse)) { /* some background tasks */[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
} if (ret == -1 && ret2 != -1) ret = ret2;note that alertDidEnd sets my "ret" variable. I can't use runModal: because I need to do some background tasks.
The above technique works quite well for all practical intents and purposes. I'm aware that application-modal window sheets aren't a generally good idea, but the sheets pertain specifically to the documents shown in the window, so they're a much better idea than application-modal alerts.
Would it be possible to add a control to the alert that is invisible, buthas the desired extra keyEquivalent?Sure, if you feel like confusing all your accessibility and VoiceOver users with spurious invisible controls.
I see, that's a good point.I also don't want to confuse my majority of other users with the lack of key bindings that they're used to...
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com