1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- //
- // KMCancellationWindowController.swift
- // PDF Reader Pro
- //
- // Created by lizhe on 2023/4/20.
- //
- import Cocoa
- var cancellationController: KMCancellationWindowController?
- var cancellationMainWindow: NSWindow?
- class KMCancellationWindowController: NSWindowController {
- @IBOutlet weak var cancellationSuccessView: KMCancellationSuccessView!
-
- deinit {
- KMPrint("KMCancellationWindowController 释放")
- }
- override func windowDidLoad() {
- super.windowDidLoad()
- // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
- self.setup()
- }
-
- //MARK: 打开文件
- static func show(window: NSWindow) -> KMCancellationWindowController {
- let controller: KMCancellationWindowController = KMCancellationWindowController.init(windowNibName: "KMCancellationWindowController")
- window.beginSheet(controller.window!)
- controller.window?.center()
- cancellationController = controller
- cancellationMainWindow = window
- return controller
- }
-
- func setup() {
- self.window?.contentView?.backgroundColor(NSColor.km_init(hex: "#FFFFFF"))
-
- self.cancellationSuccessView.cancelAction = { view in
- cancellationMainWindow?.endSheet(view.window!)
- view.window?.close()
- cancellationMainWindow = nil
- cancellationController = nil
- }
- }
- }
- extension KMCancellationWindowController {
-
- }
|