Creating a tiny framework

So why do we need another framework on top of Tkinter? If we need to build just a single program, we need not build a framework. However, if we find ourselves writing the same boilerplate code over and over again, a framework is what we need. That is, a framework is a tool that lets us easily generate generic and often-used patterns with ease.

Consider, for example, menus used in programs. A menu is such a common element in most programs, yet we need to handcraft each menu item every time we sit down to write a program. What if we could further abstract to simplify menu generation?

This is where frameworks come in handy.

Say you have a program that has 10 different top-level menus. Say each of the top-level menus ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.