Sunday, October 30, 2022

Quint_

 Below, the quintessential use of OOP to create a Gui. From 

John Philip Jones' tkinter series on YouTube. Two things to notice

here: how the_window becomes my_window when in use; how StringVar

is used to keep things going...


                                                     

Below, from W3schools, inheritance in its simplest terms. The parent class

prints out messages, so the child will print any message it is passed.

                                                                    

In the context of tkinter - building a Gui - this same principle applies. The parent

 prints out Boo!, so the child will as well:

                                         


It is also possible to call the super function directly(without self)

                                                                          

Finally, one can call many child functions at once:

                                                                             


 As well, we see below how to override given parameters programatically:

the backgound on the second label turns orange on mouse enter.



           

No comments: