52 lines
1.6 KiB
Python
52 lines
1.6 KiB
Python
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(fill = "both", expand = True)
|
|
Controls_Box_Frame.pack(fill = "both", expand = True)
|
|
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_Label3 = Label(Controls_Box_Frame, text="Third Label", background = "green", justify = "center")
|
|
My_Test_Label4 = Label(Controls_Box_Frame, text="Fourth Label", background = "yellow", justify = "center")
|
|
|
|
|
|
My_Test_Label.pack(fill = "both", expand = True)
|
|
My_Test_Label2.pack(side = "left")
|
|
My_Test_Label3.pack(side = "left")
|
|
My_Test_Label4.pack(side = "left")
|
|
|
|
|
|
Root_Window.mainloop()
|
|
|
|
# Function called on Exit
|
|
def Registered_Exit():
|
|
print("Goodbye!?")
|
|
|
|
# Regestering Exit
|
|
atexit.register(Registered_Exit) |