Add Uptated-Prototype/tkinter-Test.py
This commit is contained in:
48
Uptated-Prototype/tkinter-Test.py
Normal file
48
Uptated-Prototype/tkinter-Test.py
Normal file
@@ -0,0 +1,48 @@
|
||||
from tkinter import *
|
||||
from tkinter import ttk
|
||||
import atexit
|
||||
|
||||
# Start of Code - Start of Tkinter loop
|
||||
Root_Window = Tk()
|
||||
Root_Window.title("Prototype GUI") # Sets the GUI Title
|
||||
Root_Window.geometry("500x500")
|
||||
|
||||
style = ttk.Style()
|
||||
style.configure("My.TLabel", foreground="white", background="#404040")
|
||||
|
||||
# Attempts to create a Input Frame
|
||||
try:
|
||||
Input_Box_Frame = ttk.Frame(Root_Window)
|
||||
except Exception as e:
|
||||
print(e, type(e))
|
||||
print("An exception occurred - when creating input Frame.")
|
||||
# Attempts to create a Controls Frame
|
||||
try:
|
||||
Controls_Box_Frame = ttk.Frame(Root_Window)
|
||||
except Exception as e:
|
||||
print(e, type(e))
|
||||
print("An exception occurred - when creating Controls Frame.")
|
||||
|
||||
try:
|
||||
Input_Box_Frame.pack()
|
||||
Controls_Box_Frame.pack()
|
||||
except Exception as e:
|
||||
print(e, type(e))
|
||||
print("An exception occurred - when placing Frames.")
|
||||
|
||||
My_Test_Label = Label(Input_Box_Frame, text="First Label", background = "red", justify = "center")
|
||||
My_Test_Label2 = Label(Controls_Box_Frame, text="Second Label", background = "blue", justify = "center")
|
||||
|
||||
|
||||
My_Test_Label.pack()
|
||||
My_Test_Label2.pack()
|
||||
|
||||
|
||||
Root_Window.mainloop()
|
||||
|
||||
# Function called on Exit
|
||||
def Registered_Exit():
|
||||
print("Goodbye!?")
|
||||
|
||||
# Regestering Exit
|
||||
atexit.register(Registered_Exit)
|
||||
Reference in New Issue
Block a user