Last active
May 2, 2016 08:48
-
-
Save EternityGerwin/c9b763eb1c915042b9489131235d4852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win : NSWindow? = nil; | |
class ViewController: NSViewController{ | |
//.. | |
override func KeyDown(theEvent:NSEVENT){ | |
f.KeyDown(theEvent); | |
if let keyString = theEvent.charactersIgnoringModifiers where keyString == "u" || keyString == "U"{ | |
if(win == nil){ | |
win = NSWindow(contentRect : NSMakeRect(100, 100, 600, 200). | |
- styleMask: NSResizeAbleWindowMask, | |
- backing:NSBackingStoreType.Buffered, defer: false); | |
self.view.window?.addChildWindow(win, ordered: .Above); | |
win.makeKeyAndOrderFront(theEvent); | |
} | |
else{ | |
win.close(); | |
se;f.view.window?.removeChildWindow(win!); | |
win = nil; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment