Reputation: 11
I'm new to GUI-programming and using now tkinter for python.
In the past my "non-GUI" programs always consisted out of a few classes but if I look to the examples with a GUI it appears that only one class is used. All functions are included in this one class. Is this the normal way or is it possible to write a gui class which "calls" functions from other classes?
As I look at it now it seems the concept of object oriented programming dissapears by implementing the GUI in an OOP manner
Upvotes: 1
Views: 141
Reputation: 3010
It is definitely possible to use multiple classes in GUI apps.
For example you can have one class which defines and layouts GUI elements (like buttons, text fields, scrollbars etc.) and the second class would subclass it adding some functionality on top of it.
Upvotes: 3