-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtray.py
67 lines (52 loc) · 1.82 KB
/
tray.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from pystray import MenuItem as item
import pystray
from PIL import Image
import tkinter as tk
def show_window():
icon.stop()
def quit_window():
icon.stop()
image = Image.open("logo_title.ico")
menu = (item('Quit', quit_window), item('Show', show_window))
icon = pystray.Icon("name", image, "title", menu)
icon.run()
# window = tk.Tk()
# window.title("Welcome")
# def quit_window(icon, item):
# icon.stop()
# window.destroy()
# def show_window(icon, item):
# icon.stop()
# window.after(0,window.deiconify)
# def withdraw_window():
# window.withdraw()
# image = Image.open("logo_title.ico")
# menu = (item('Quit', quit_window), item('Show', show_window))
# icon = pystray.Icon("name", image, "title", menu)
# icon.run()
# if __name__ == '__main__':
# withdraw_window()
# window.mainloop()
# class Tray():
# from infi.systray import SysTrayIcon
# def __init__(self):
# self.hover_text = "18K"
# self.menu_options = (('Say Hello', "Logo.png", self.hello),
# ('Do nothing', None, self.do_nothing),
# ('A sub-menu', "Logo.png", (('Say Hello to Simon', "Logo.png", self.simon),
# ('Do nothing', None, self.do_nothing),
# ))
# )
# self.sysTrayIcon = self.SysTrayIcon("main.ico", self.hover_text, self.menu_options, default_menu_index=1)
# def hello(self, *args):
# print("Hello World")
# Window.show()
# def simon(self, *args):
# print("Hello Simon")
# def bye(self, *args):
# print('Bye, then.')
# self.sysTrayIcon.shutdown()
# def do_nothing(self, *args):
# pass
# def start_up(self, *args):
# self.sysTrayIcon.start()