Reader small image

You're reading from  Python GUI Programming with Tkinter, 2nd edition - Second Edition

Product typeBook
Published inOct 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781801815925
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Alan D. Moore
Alan D. Moore
author image
Alan D. Moore

Alan D. Moore is a data analyst and software developer who has been solving problems with Python since 2006. He's developed both open source and private code using frameworks like Django, Flask, Qt, and of course Tkinter, and is known to contribute to various open-source Python and JavaScript projects. Alan maintains a YouTube channel, “Alan D Moore Codes”, where he posts Python, PyQt, and Tkinter tutorials. Alan lives in Franklin, Tennessee, where he works for the County Government, and with his wife Cara raises a crew of children who are just as geeky as their dad.
Read more about Alan D. Moore

Right arrow

Using classes with Tkinter

GUI frameworks and object-oriented code go hand in hand. While Tkinter, more than most frameworks, allows you to create GUIs using procedural programming, we miss out on a great deal of organizational power in doing so. Although we'll find many ways to use classes in our Tkinter code throughout this book, we'll look at three primary ways of using them here:

  • Improving or expanding Tkinter classes for more power
  • Creating compound widgets to save repetitive typing
  • Organizing our application into self-contained components

Improving Tkinter classes

Let's face it: some Tkinter objects are a little lacking in functionality. We can fix that by subclassing Tkinter classes and making our own improved versions. For instance, while we've seen that Tkinter control variable classes are useful, hey are limited to string, integer, double, and Boolean types. What if we wanted the functionality of these variables, but...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Python GUI Programming with Tkinter, 2nd edition - Second Edition
Published in: Oct 2021Publisher: PacktISBN-13: 9781801815925

Author (1)

author image
Alan D. Moore

Alan D. Moore is a data analyst and software developer who has been solving problems with Python since 2006. He's developed both open source and private code using frameworks like Django, Flask, Qt, and of course Tkinter, and is known to contribute to various open-source Python and JavaScript projects. Alan maintains a YouTube channel, “Alan D Moore Codes”, where he posts Python, PyQt, and Tkinter tutorials. Alan lives in Franklin, Tennessee, where he works for the County Government, and with his wife Cara raises a crew of children who are just as geeky as their dad.
Read more about Alan D. Moore