-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.py
46 lines (33 loc) · 1.4 KB
/
info.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
import tkinter as tk
import webbrowser
def open_info_window():
# Makes and shows info window on button press.
tomuto_info = tk.Toplevel()
tomuto_info.title("tomuto - info")
tomuto_info.iconbitmap("resources/icon.ico")
# Geometry info
screen_width = tomuto_info.winfo_screenwidth()
screen_height = tomuto_info.winfo_screenheight()
x = (screen_width/2) - (300/2)
y = (screen_height/2) - (100/2)
tomuto_info.geometry("270x165+" + str(int(x-50)) + "+" + str(int(y)-40))
tomuto_info.resizable(0, 0)
# Widgets
tomuto_name = tk.Label(tomuto_info, text="tomuto")
tomuto_name.config(font=("Verdana", 20), fg='red')
tomuto_name.pack()
description = tk.Label(tomuto_info, text='open source tomato timer')
description.pack(pady=(0, 10))
github = tk.Label(tomuto_info, text="More info and source code:")
github.pack()
link = tk.Label(tomuto_info, text="tomuto on Github", fg='blue', cursor='hand2')
link.pack()
link.bind("<Button-1>", lambda l: callback("https://github.com/mateuscv/tomuto"))
original_developer = tk.Label(tomuto_info, text="Created with ♥ by Mateus Cappellari Vieira")
original_developer.pack(pady=(10, 0))
version = tk.Label(tomuto_info, text='v1.0.0')
version.pack(pady=(1, 0))
version.config(font=("Verdana", 8), fg='gray')
def callback(url):
# Opens the github link
webbrowser.open_new(url)