diff --git a/Projects/1-Beginner/Calculator-App/Calculator-App.py b/Projects/1-Beginner/Calculator-App/Calculator-App.py index 5aad406f..7d3f8afe 100644 --- a/Projects/1-Beginner/Calculator-App/Calculator-App.py +++ b/Projects/1-Beginner/Calculator-App/Calculator-App.py @@ -3,7 +3,7 @@ import tkinter as tk class Main(ttk.Window): def __init__(self, title, dimensions): - super().__init__(self) + super().__init__(self, themename="darkly") self.title(title) self.geometry(dimensions) @@ -17,20 +17,23 @@ class Calculator(): # The best way to place the buttons is ussing grid # It also require a main frame # 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.Configure() - 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.CreateFrames() 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.Configure() self.GridButtons() 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): l= 0 for j in range (6):