1234567891011121314151617181920212223242526272829 |
- //
- // KMPopupMenuObject.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2023/11/21.
- //
- import Cocoa
- class KMPopupMenuObject: NSObject {
- var menuTag: Int = 0
- var enterControllerCallback: ((_ isEnter: Bool)->Void)?
- }
- extension KMPopupMenuObject: NSMenuDelegate {
- func menuWillOpen(_ menu: NSMenu) {
- guard let callback = self.enterControllerCallback else {
- return
- }
- callback(true)
- }
-
- func menuDidClose(_ menu: NSMenu) {
- guard let callback = self.enterControllerCallback else {
- return
- }
- callback(false)
- }
- }
|