如何在单独的NIB中放置一个窗口,给它自己的NSWindowController,让它作为一张纸滑出?
(这是与床单有关的典型事吗?)
我试图从我的主窗口显示一个自定义工作表(从父窗口的标题栏向下滑动的窗口).我想,我想要做的就是标准,但是我找不到明确的例子或解释如何做到我想要的.
我想做什么:
- (void)showCustomSheet: (NSWindow *)window
// User has asked to see the custom display. Display it.
{
if (!settingsSheet)
//Check the settingsSheet instance variable to make sure the custom sheet does not already exist.
[NSBundle loadNibNamed:@"SettingsSheet" owner: self];
//BUT HOW DOES THIS MAKE settingsSheet NOT nil?
[NSApp beginSheet: settingsSheet
modalForWindow: window
modalDelegate: self
didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
contextInfo: nil];
// Sheet is up here.
// Return processing to the event loop
} …Run Code Online (Sandbox Code Playgroud) 这是一个新手问题!
如何在Cocoa中创建和显示自定义工作表?(如Safari中的"添加书签"表 - 见下文)