TVP
TVP

Reputation: 11

Only one Class possible for GUI programming

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

Answers (1)

kchomski
kchomski

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

Related Questions