-
Notifications
You must be signed in to change notification settings - Fork 4
/
about_window.py
47 lines (42 loc) · 1.56 KB
/
about_window.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
import tkinter as tk
import tkinter.ttk as ttk
import webbrowser
class About(tk.Toplevel):
def __init__(self, master):
self.root = master
super().__init__(self.root)
self.wm_resizable(width=False, height=False)
self.title('About')
self.wm_attributes('-toolwindow', True)
self.grab_set()
self.frame = ttk.Frame(self)
self.frame.pack()
self.msg = tk.Message(
self.frame,
text='WiFi Password Revealer is a work in progress.',
width=300)
self.msg2 = tk.Message(
self.frame,
text='For help and information, please visit the project\'s Github page.',
width=300)
self.link = tk.Label(
self.frame,
text=r'www.github.com/jgrigg2017/WiFi_Password_Viewer',
fg='blue',
cursor='hand2')
self.link.bind(
'<Button-1>',
lambda event=None: webbrowser.open_new(event.widget.cget('text')))
self.msg.pack()
self.msg2.pack()
self.link.pack()
self.protocol("WM_DELETE_WINDOW", self.exit)
sw = min([self.root.winfo_x() + self.root.winfo_width() / 2 - 150, self.root.winfo_screenwidth() - 300])
sw = max([0, sw])
sh = min([self.root.winfo_y() + self.root.winfo_height() / 2 - 50, self.root.winfo_screenheight() - 150])
sh = max([0, sh])
print(self.root.winfo_width())
self.geometry('300x100+%d+%d' % (sw, sh))
def exit(self, event=None):
self.root.focus_set()
self.destroy()