
Fourth Edition: thoroughly revised and expanded! Updated for Python 3.14. Now includes Tkinter API reference, and bonus material on structuring and refining Tkinter code and third-party themes and widgets.
Quickly learn the right way to build attractive and modern graphical user interfaces with Python and Tkinter, its standard GUI toolkit.
Tkinter has been around forever. There's a lot of documentation, much of it created years ago. But it's all wrong. Tkinter took a quantum leap forward since that documentation was written. Your program needs to be written differently to take advantage of that. Modern Tkinter shows you the right way to do it.
Whether you're entirely new to Tkinter, or just need to bring your Tkinter knowledge up to date, this book gives you all you need to build modern, attractive Tkinter user interfaces that run on Windows, macOS, and Linux.
You'll learn all the modern best practices. You'll build your user interface the right way the first time, without having to learn anything extra or irrelevant. It starts at the beginning, shows you what you need to know, and covers all the essential elements of building your modern user interface. This includes:
all the standard GUI widgets attractively laying out your user interface managing menus, windows, and dialogs organizing more complex user interfaces Tkinter's powerhouse widgets: canvas and text customizing the look of your user interface making it all work on macOS, Windows, and LinuxYou may have been using older documentation or are updating a Tkinter program written years ago. If so, you'll find warnings of what to avoid using, and how to replace it with a modern solution. There's even a full case study of modernizing the user interface of a seriously out-of-date Tkinter application you may be familiar with.
Let veteran software developer Mark Roseman show you the right way to build user interfaces with Python and Tkinter. He's been using Tk (the technology behind Tkinter) since its early days. He's shipped dozens of open source tools and commercial applications based on it.
He's also the author of the multi-lingual TkDocs tutorial, the de facto online guide for building modern Tk user interfaces. This book brings together all new material and Python-specific information from that tutorial.
Contents
Introduction Tk and Tkinter: Then and Now Installing Tkinter A First (Real) Example Tkinter Concepts Basic Widgets The Grid Geometry Manager Structuring Tkinter Code Refining our Code More Widgets Event Loop Menus Windows and Dialogs Organizing Complex Interfaces Fonts, Colors, Images Canvas Text Treeview Styles and Themes Custom Styles and Themes Case Study: IDLE Modernization Appendix: Tkinter Class API ReferenceWe publiceren alleen reviews die voldoen aan de voorwaarden voor reviews. Bekijk onze voorwaarden voor reviews.