MCPcopy Create free account
hub / github.com/T-duality/PillOCR-python / create_tray_icon

Method create_tray_icon

GPTOCRGUI.py:749–767  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

747 self.log("已停止处理")
748
749 def create_tray_icon(self):
750 width, height = 64, 32
751 base_icon = self.create_capsule_icon('grey')
752 self.icon_image = {
753 'processing': self.create_capsule_icon('grey'),
754 'success': self.create_capsule_icon('green'),
755 'error': self.create_capsule_icon('red'),
756 }
757 self.icon = pystray.Icon(
758 "name",
759 base_icon,
760 "PillOCR"
761 )
762 self.icon.menu = self.create_menu()
763 # hand control of the AppKit run loop back to Tkinter
764 if platform.system() == "Darwin" and hasattr(self.icon, "run_detached"):
765 self.icon.run_detached()
766 else:
767 threading.Thread(target=self.icon.run, daemon=True).start()
768
769 def create_menu(self):
770 """创建托盘菜单"""

Callers 1

__init__Method · 0.95

Calls 3

create_capsule_iconMethod · 0.95
create_menuMethod · 0.95
startMethod · 0.80

Tested by

no test coverage detected