How to use the pystray._util.win32.LR_LOADFROMFILE function in pystray

To help you get started, we’ve selected a few pystray examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github typeworld / guiapp / wxPython / daemon_2.py View on Github external
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):
				def applicationDidFinishLaunching_(self, aNotification):
					icon.run()