Guest User

Untitled

a guest
Jan 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. [[NSApplication sharedApplication] runModalForWindow:mainWindow];
  2.  
  3. - (void)windowWillClose:(NSNotification *)notification {
  4. [[NSApplication sharedApplication] stopModal];
  5. }
  6.  
  7. - (void)showSheet:(id)sender
  8. {
  9. [NSApp beginSheet:yourModalWindow
  10. modalForWindow:windowThatSheetIsAttachedTo
  11. modalDelegate:self
  12. didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
  13. contextInfo:nil];
  14. }
  15.  
  16. - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
  17. {
  18. [sheet orderOut:self];
  19. [NSApp endSheet:sheet];
  20. }
  21.  
  22. [[NSApplication sharedApplication] stopModal];
  23.  
  24. window.beginSheet(self.uiSettingsPanel, completionHandler: {response in
  25. NSLog("Finished sheet, response: (response)")
  26. })
  27.  
  28. @IBAction func buttonOK(_ sender: NSButton) {
  29. self.sheetParent!.endSheet(self, returnCode: .OK)
  30. }
Add Comment
Please, Sign In to add comment