diff options
author | Dmitry Moiseev <m0sia@m0sia.ru> | 2014-01-17 17:11:44 +0600 |
---|---|---|
committer | Dmitry Moiseev <m0sia@m0sia.ru> | 2014-01-17 17:11:44 +0600 |
commit | 4602b9773fa780640d7bd6a944e0778afcd96db6 (patch) | |
tree | 21d4bacf3610603e56af4e095ae4ff8ce487b923 | |
parent | 8ca32292d1bd5bbe8ae52c770d43632c7982f0ee (diff) | |
download | pyParrotZikTCP-4602b9773fa780640d7bd6a944e0778afcd96db6.tar.xz pyParrotZikTCP-4602b9773fa780640d7bd6a944e0778afcd96db6.zip |
Moved StatusApp(NSApplication) class to separate fil
-rw-r--r-- | StatusAppMac.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/StatusAppMac.py b/StatusAppMac.py new file mode 100644 index 0000000..fc0bc64 --- /dev/null +++ b/StatusAppMac.py @@ -0,0 +1,25 @@ +import objc +from Foundation import * +from AppKit import * +from PyObjCTools import AppHelper + +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!')
\ No newline at end of file |