From 8ca32292d1bd5bbe8ae52c770d43632c7982f0ee Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Fri, 17 Jan 2014 17:11:06 +0600 Subject: Moved mac NSObject class to separate file --- SysIndicator.py | 22 +--------------------- 1 file changed, 1 insertion(+), 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": -- cgit v1.2.1