Skip to content

Instantly share code, notes, and snippets.

@rampatra
Created May 24, 2020 18:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rampatra/6698d95babaf944ecccbe37aecd7281c to your computer and use it in GitHub Desktop.
Save rampatra/6698d95babaf944ecccbe37aecd7281c to your computer and use it in GitHub Desktop.
Show the window
// Show Annotate Screen window and make it key
let window = annotateWindowController.window!
guard let screen = NSScreen.main else { return }
window.setFrame(screen.visibleFrame, display: true)
window.backgroundColor = NSColor.white.withAlphaComponent(0.001)
window.level = NSWindow.Level.popUpMenu
window.orderFrontRegardless()
window.makeKeyAndOrderFront(self)
NSApp.activate(ignoringOtherApps: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment