-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartManager.py
More file actions
52 lines (37 loc) · 1.38 KB
/
startManager.py
File metadata and controls
52 lines (37 loc) · 1.38 KB
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
from tkinter import *
from tkinter.font import *
class Main:
def __init__(self, master):
#Creates Main Window
Win.buildMainWindow(self, master)
class Win:
def buildMainWindow(self, master):
# User can interact with Main Window after successfully logging in
# Window is created then set off-screen
self.master = master
self.window_main = master
self.window_main.geometry('1200x800+300+100')
#self.window_main.geometry(f'{winStat.getScreenSize("x")}x{winStat.getScreenSize("y")}+0+0')
self.window_main.overrideredirect(True)
self.window_main.title("Window app")
keyInput.addHotKey(master, "<Escape>", lambda event, r=self.window_main: keyInput.escape(event, r))
#btn = Button(self.window_main, text="Create a widget", command= lambda s=master: WidgetCreation.create(s))
#btn.pack(pady = 10)
class winStat:
def getScreenSize(v):
if v == 'x':
return root.winfo_screenwidth()
return root.winfo_screenheight()
class keyInput:
def addHotKey(root, key, command):
root.bind(key, command)
def escape(event, root):
root.destroy()
class WidgetCreation:
def create(rootlevel):
win = Toplevel(rootlevel)
win.geometry('800x600+0+0')
win.overrideredirect(False)
root = Tk()
window = Main(root)
root.mainloop()