Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# exit()
menu = (item(localize('Open Type.World App'), openApp, default=True), item(localize('Check for font updates now'), checkForUpdates))#, pystray.Menu.SEPARATOR, item('Quit', quitIcon))
if MAC:
image = NSImage.alloc().initWithContentsOfFile_(NSBundle.mainBundle().pathForResource_ofType_('MacSystemTrayIcon', 'pdf'))
image.setTemplate_(True)
image_notification = NSImage.alloc().initWithContentsOfFile_(NSBundle.mainBundle().pathForResource_ofType_('MacSystemTrayIcon_Notification', 'pdf'))
image_notification.setTemplate_(True)
if WIN:
image = win32.LoadImage(
None,
os.path.join(os.path.dirname(__file__), 'icon', 'TaskbarIcon.ico'),
win32.IMAGE_ICON,
0,
0,
win32.LR_DEFAULTSIZE | win32.LR_LOADFROMFILE)
image_notification = win32.LoadImage(
None,
os.path.join(os.path.dirname(__file__), 'icon', 'TaskbarIcon_Notification.ico'),
win32.IMAGE_ICON,
0,
0,
win32.LR_DEFAULTSIZE | win32.LR_LOADFROMFILE)
icon = pystray.Icon("Type.World", image, "Type.World", menu)
if MAC:
class Delegate(NSObject):
image.setTemplate_(True)
image_notification = NSImage.alloc().initWithContentsOfFile_(NSBundle.mainBundle().pathForResource_ofType_('MacSystemTrayIcon_Notification', 'pdf'))
image_notification.setTemplate_(True)
if WIN:
image = win32.LoadImage(
None,
os.path.join(os.path.dirname(__file__), 'icon', 'TaskbarIcon.ico'),
win32.IMAGE_ICON,
0,
0,
win32.LR_DEFAULTSIZE | win32.LR_LOADFROMFILE)
image_notification = win32.LoadImage(
None,
os.path.join(os.path.dirname(__file__), 'icon', 'TaskbarIcon_Notification.ico'),
win32.IMAGE_ICON,
0,
0,
win32.LR_DEFAULTSIZE | win32.LR_LOADFROMFILE)
icon = pystray.Icon("Type.World", image, "Type.World", menu)
if MAC:
class Delegate(NSObject):
def applicationDidFinishLaunching_(self, aNotification):
icon.run()
NSUserNotificationCenterDelegate = objc.protocolNamed('NSUserNotificationCenterDelegate')
class NotificationDelegate(NSObject, protocols=[NSUserNotificationCenterDelegate]):
def userNotificationCenter_didActivateNotification_(self, center, aNotification):