The choice between class GeneralGuiDesigner(tk.Tk) and class GeneralGuiDesigner depends on how you want to manage root window of the application, but inheriting from tk.Tk (the first option) is generally preferred for the main application class because it makes the main window self-contained and simplifies the code. -------------------------------------------------------------------------------- | Feature | class GeneralGuiDesigner(tk.Tk) |------------------------------------------------------------------------------- | Architecture | Inheritance: The class is the main window itself | Root Management | Instantiated inside the class via super().__init__() | Method Access | Can call window methods directly e.g. self.title() | Best Used For | The absolute main window of a complex application. |------------------------------------------------------------------------------- | Feature | class GeneralGuiDesigner (Standard Class) |------------------------------------------------------------------------------- | Architecture | Composition: class has or receives a reference to a window | Root Management | Instantiated externally via root = tk.Tk() and passed in | Method Access | Must reference the passed object e.g. master.title() | Best Used For | Reusable UI components, widgets, or small dialog scripts. -------------------------------------------------------------------------------- 1. class GeneralGuiDesigner(tk.Tk) (Inheritance) -------------------------------------------------------------------------------- By inheriting from tk.Tk, class becomes a customized version of the Tkinter root window. import tkinter as tk class GeneralGuiDesigner(tk.Tk): def __init__(self): super().__init__() # Initializes the tk.Tk main window self.title("Main Application") self.geometry("400x300") # 'self' acts as the master widget directly self.label = tk.Label(self, text="Hello World") self.label.pack() if __name__ == "__main__": app = GeneralGuiDesigner() app.mainloop() # Run the event loop directly on the object *Why use it: It keeps the code clean. You don't have to keep passing a root or master variable around because self is the root window. It provides a clean entry point for larger applications. -------------------------------------------------------------------------------- 2. class GeneralGuiDesigner (Composition) -------------------------------------------------------------------------------- A standard Python class does not inherit any Tkinter properties. Instead, you must explicitly create a tk.Tk() instance outside the class and pass it into the constructor as a master or root window. import tkinter as tk class GeneralGuiDesigner: def __init__(self, master): self.master = master # Store reference to the external window self.master.title("Main Application") self.master.geometry("400x300") # Must explicitly reference self.master as the parent self.label = tk.Label(self.master, text="Hello World") self.label.pack() if __name__ == "__main__": root = tk.Tk() # Create the window externally app = GeneralGuiDesigner(root) root.mainloop() *Why use it: This approach is more flexible if you want to swap out the parent window or if your class represents a smaller, reusable component (like a custom toolbar or form panel) rather than the entire application window. -------------------------------------------------------------------------------- Which one should you use? -------------------------------------------------------------------------------- * Use class GeneralGuiDesigner(tk.Tk) if this class represents the entire core wrapper of your application. It is the standard modern layout for building scalable Tkinter projects. * Use class GeneralGuiDesigner (or inherit from tk.Frame instead) if you plan on nesting this layout inside other windows, or if you prefer keeping the Tkinter window cycle strictly separated from your custom class logic.