Chapter 4. Data and Classes

In this chapter, we will use data and OOP classes using Python 3:

  • How to use StringVar()
  • How to get data from a widget
  • Using module-level global variables
  • How coding in classes can improve the GUI
  • Writing callback functions
  • Creating reusable GUI components

Introduction

In this chapter, we will save our GUI data into tkinter variables.

We will also start using object-oriented programming (OOP) to extend the existing tkinter classes in order to extend tkinter's built-in functionality. This will lead us into creating reusable OOP components.

Get Python GUI Programming Cookbook 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.