Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [[NSApplication sharedApplication] runModalForWindow:mainWindow];
- - (void)windowWillClose:(NSNotification *)notification {
- [[NSApplication sharedApplication] stopModal];
- }
- - (void)showSheet:(id)sender
- {
- [NSApp beginSheet:yourModalWindow
- modalForWindow:windowThatSheetIsAttachedTo
- modalDelegate:self
- didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
- contextInfo:nil];
- }
- - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
- {
- [sheet orderOut:self];
- [NSApp endSheet:sheet];
- }
- [[NSApplication sharedApplication] stopModal];
- window.beginSheet(self.uiSettingsPanel, completionHandler: {response in
- NSLog("Finished sheet, response: (response)")
- })
- @IBAction func buttonOK(_ sender: NSButton) {
- self.sheetParent!.endSheet(self, returnCode: .OK)
- }
Add Comment
Please, Sign In to add comment