开发者

How to get NSAlert sheet to return focus to calling window?

开发者 https://www.devze.com 2022-12-12 04:15 出处:网络
I have an OS X prefpane that calls a NSAlert sheet with: [alert beginSheetModalForWindow:[[self mainView] window] modalDelegate:self didEndSelector:@selector(unsavedChangesAlertDidEnd:returnCode:con

I have an OS X prefpane that calls a NSAlert sheet with:

 [alert beginSheetModalForWindow:[[self mainView] window] modalDelegate:self didEndSelector:@selector(unsavedChangesAlertDidEnd:returnCode:contextInfo:) contextInfo:nil];

Which shows the alert sheet attached to the System Preferences application fine, but when I click the sheet's OK button, it closes and does开发者_运维知识库n't return focus to System Preferences. Any ideas?


Try sending that window a -makeKeyAndOrderFront: message at the end of your -unsavedChangesAlertDidEnd:returnCode:contextInfo: method.

0

精彩评论

暂无评论...
验证码 换一张
取 消