Mar-22-2019, 11:33 PM
Quote:I am trying to understand the process by which widgets are added to the GUI using classes in this manner.You really should spend some time learning about classes in general.
a widget is a class as a matter of fact everything in python is a class
To show this, consider this example:
>>> a = 5 >>> type(a) <class 'int'> >>>a is an instance of class int
as for widgets:
>>> import tkinter >>> root = tkinter.Tk() >>> type(root) <class 'tkinter.Tk'> >>> label_a = tkinter.Label(text='abc') >>> type(label_a) <class 'tkinter.Label'> >>> # If you want to see methods and attributes for Label: >>> help(tkinter.Label) ...here are some tutorials on classes:
Class Basics
Class Intermediate: Inheritance
Class Intermediate: Operator Overloading
Classes [advanced]: Dependent attributes (and Descriptors)
Classes [advanced]: Descriptors (managed attributes)