mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Makes first attempt to connect up an in-machine open panel.
This commit is contained in:
parent
101fb5d7bf
commit
c939a274be
@ -116,6 +116,11 @@
|
|||||||
<action selector="saveScreenshot:" target="-1" id="7ky-xD-tip"/>
|
<action selector="saveScreenshot:" target="-1" id="7ky-xD-tip"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
|
<menuItem title="Insert..." keyEquivalent="O" id="qQa-kh-4nz">
|
||||||
|
<connections>
|
||||||
|
<action selector="insertMedia:" target="-1" id="9Hs-9J-dlY"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="rXU-KX-GkZ"/>
|
<menuItem isSeparatorItem="YES" id="rXU-KX-GkZ"/>
|
||||||
<menuItem title="Page Setup…" enabled="NO" keyEquivalent="P" id="qIS-W8-SiK">
|
<menuItem title="Page Setup…" enabled="NO" keyEquivalent="P" id="qIS-W8-SiK">
|
||||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||||
|
@ -213,6 +213,7 @@ class MachineDocument:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: Runtime media insertion.
|
||||||
final func openGLView(_ view: CSOpenGLView, didReceiveFileAt URL: URL) {
|
final func openGLView(_ view: CSOpenGLView, didReceiveFileAt URL: URL) {
|
||||||
let mediaSet = CSMediaSet(fileAt: URL)
|
let mediaSet = CSMediaSet(fileAt: URL)
|
||||||
if let mediaSet = mediaSet {
|
if let mediaSet = mediaSet {
|
||||||
@ -220,6 +221,16 @@ class MachineDocument:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBAction final func insertMedia(_ sender: AnyObject!) {
|
||||||
|
let panel = NSOpenPanel()
|
||||||
|
self.openGLView.window!.beginSheet(panel) { (response) in
|
||||||
|
if response == .OK {
|
||||||
|
Swift.print("An animal")
|
||||||
|
}
|
||||||
|
Swift.print("\(response)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: NSDocument overrides
|
// MARK: NSDocument overrides
|
||||||
override func data(ofType typeName: String) throws -> Data {
|
override func data(ofType typeName: String) throws -> Data {
|
||||||
throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil)
|
throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user