diff options
Diffstat (limited to '')
-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 |