【发布时间】:2012-12-14 15:03:41
【问题描述】:
就像在 NSWindow 中单击按钮后显示的 NSPanel。
我找了很多,但没有简单的例子。 感谢您的帮助。
【问题讨论】:
标签: xcode modal-dialog nswindow nspanel
就像在 NSWindow 中单击按钮后显示的 NSPanel。
我找了很多,但没有简单的例子。 感谢您的帮助。
【问题讨论】:
标签: xcode modal-dialog nswindow nspanel
可以这样做:
-(IBAction)showButtonAction:(id)sender {
[[NSApplication sharedApplication] beginSheet:panelOutlet
modalForWindow:self.window
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
注意:
不要忘记取消选中
NSPanel的 Visible At Launch 复选框 Attributes Inspector 和 Release When Closed 如果您不会使用此面板一次。
结果:
【讨论】:
NSSheet而不是NSPanel吗?