Theme changed

pull/923/head
BPM17 1 month ago
parent 29491be246
commit 4984c5f68b

@ -3,7 +3,7 @@ import tkinter as tk
class Main(ttk.Window): class Main(ttk.Window):
def __init__(self, title, dimensions): def __init__(self, title, dimensions):
super().__init__(self) super().__init__(self, themename="darkly")
self.title(title) self.title(title)
self.geometry(dimensions) self.geometry(dimensions)
@ -17,20 +17,23 @@ class Calculator():
# The best way to place the buttons is ussing grid # The best way to place the buttons is ussing grid
# It also require a main frame # It also require a main frame
# The frame is also the master for the buttons and the label # The frame is also the master for the buttons and the label
self.mainFrame = ttk.Frame(self.main, height=400, width=300)
self.mainFrame.pack(padx=5, pady=5, fill="both", expand=True)
self.buttonsSimbols=["A/C", "+/-", "/", "<-", "7","8","9","x", "4","5","6","-", "1","2","3","+", "0", ".", "="] self.buttonsSimbols=["A/C", "+/-", "/", "<-", "7","8","9","x", "4","5","6","-", "1","2","3","+", "0", ".", "="]
self.Configure() self.CreateFrames()
self.screenFrame = ttk.Frame(self.mainFrame)
self.screenFrame.pack(padx=0, pady=0, expand=True)
self.buttonsFrame = ttk.Frame(self.mainFrame)
self.buttonsFrame.pack(padx=0, pady=0, expand=True)
self.screen = ttk.Label(self.screenFrame, text="HOLA MUNDO", font=("Arial", 20, "bold"),justify="right") self.screen = ttk.Label(self.screenFrame, text="HOLA MUNDO", font=("Arial", 20, "bold"),justify="right")
self.screen.pack(padx=10, pady=10, expand=True) self.screen.pack(padx=10, pady=10, expand=True)
self.Configure()
self.GridButtons() self.GridButtons()
self.main.mainloop() self.main.mainloop()
def CreateFrames(self):
self.mainFrame = ttk.Frame(self.main, height=400, width=300)
self.mainFrame.pack(padx=5, pady=5, fill="both", expand=True)
self.screenFrame = ttk.Frame(self.mainFrame)
self.screenFrame.pack(padx=0, pady=0, expand=True)
self.buttonsFrame = ttk.Frame(self.mainFrame)
self.buttonsFrame.pack(padx=0, pady=0, expand=True)
def GridButtons(self): def GridButtons(self):
l= 0 l= 0
for j in range (6): for j in range (6):

Loading…
Cancel
Save