aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Moiseev <m0sia@m0sia.ru>2014-01-17 17:11:06 +0600
committerDmitry Moiseev <m0sia@m0sia.ru>2014-01-17 17:11:06 +0600
commit8ca32292d1bd5bbe8ae52c770d43632c7982f0ee (patch)
tree2bb5c997e63180989eccae38e5f8afb1933fa647
parent3e3ce4b8a034ce88dba7cd11e41175a92d29983c (diff)
downloadpyParrotZikTCP-8ca32292d1bd5bbe8ae52c770d43632c7982f0ee.tar.xz
pyParrotZikTCP-8ca32292d1bd5bbe8ae52c770d43632c7982f0ee.zip
Moved mac NSObject class to separate file
-rw-r--r--SysIndicator.py22
1 files changed, 1 insertions, 21 deletions
diff --git a/SysIndicator.py b/SysIndicator.py
index 2f7689c..3c79286 100644
--- a/SysIndicator.py
+++ b/SysIndicator.py
@@ -12,29 +12,9 @@ elif sys.platform=="darwin":
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
+ from StatusAppMac import StatusApp
-class StatusApp(NSApplication):
-
- def initMenu(self,menu):
- statusbar = NSStatusBar.systemStatusBar()
- self.statusitem = statusbar.statusItemWithLength_(NSVariableStatusItemLength)
-
- self.mymenu = menu
- #add menu to statusitem
- self.statusitem.setMenu_(menu.menubarMenu)
- self.statusitem.setToolTip_('Parrot Zik Indicator')
-
- def setIcon(self,icon,icon_directory):
- self.icon = NSImage.alloc().initByReferencingFile_(icon_directory+icon+'.png')
- self.icon.setScalesWhenResized_(True)
- self.icon.setSize_((20, 20))
- self.statusitem.setImage_(self.icon)
-
- def clicked_(self, notification):
- self.mymenu.actions[notification._.title]()
- NSLog('clicked!')
-
class SysIndicator:
def __init__(self, icon,menu):
if sys.platform=="linux2":