Support closing windows

This commit is contained in:
Matt Baer 2017-08-03 20:02:16 -04:00
parent 27c398ec40
commit 14ec2eb2a5
2 changed files with 10 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
@IBAction func fileClose(_ sender: Any) {
NSApplication.shared().mainWindow!.close()
}
@IBAction func toggleNightMode(_ sender: NSMenuItem) {
let isOff = sender.state == NSOffState

View File

@ -83,6 +83,12 @@
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="Jqh-E2-bP0">
<connections>
<action selector="fileClose:" target="Voe-Tx-rLC" id="wwH-Vr-YXS"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="qlM-x5-Aiq"/>
<menuItem title="Save" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="Voe-Tx-rLC" id="6F3-Jk-bXC"/>