mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-03-11 06:49:12 +00:00
add button funcionality
This commit is contained in:
@@ -14,14 +14,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
@IBOutlet var window: NSWindow!
|
||||
|
||||
@IBAction func startStopButton(_ sender: Any) {
|
||||
print("button pressed")
|
||||
if mouseTracker.monitor != nil {
|
||||
mouseTracker.addMonitor()
|
||||
} else {
|
||||
mouseTracker.removeMonitor()
|
||||
}
|
||||
}
|
||||
var mouseTracker = MouseTracker()
|
||||
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
// Insert code here to initialize your application
|
||||
mouseTracker.addMonitor()
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
|
||||
@@ -435,6 +435,9 @@
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="startStopButton:" target="Voe-Tx-rLC" id="hVa-jw-V1p"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vxC-at-nRH">
|
||||
<rect key="frame" x="84" y="216" width="75" height="32"/>
|
||||
@@ -453,6 +456,9 @@
|
||||
<buttonCell key="cell" type="smallSquare" title="Start/Stop" bezelStyle="smallSquare" image="NSAddTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OFW-KM-Pfq">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<connections>
|
||||
<action selector="startStopButton:" target="Voe-Tx-rLC" id="qYV-K4-lqf"/>
|
||||
</connections>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
<dict>
|
||||
<key>com.apple.security.automation.apple-events</key>
|
||||
<true/>
|
||||
<key>com.apple.security.temporary-exception.apple-events</key>
|
||||
<array>
|
||||
<string>System Events</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Reference in New Issue
Block a user