How to do it...

Let's see how to perform the recipe:

  1. We will start with a Python GUI that has two tabs and then we will add more widgets to it.
  2. Create a new module: GUI_Complexity_start.py.
  3. Add the following code:
#======================# imports#======================import tkinter as tkfrom tkinter import ttkfrom tkinter import scrolledtextfrom tkinter import Menufrom tkinter import Spinboxfrom Ch11_Code.ToolTip import ToolTip
  1. Create a global variable and a class:
GLOBAL_CONST = 42#=================================================================== class OOP():    def __init__(self):         # Create instance        self.win = tk.Tk()                 # Add a title         self.win.title("Python GUI")         self.createWidgets()       # Button callback    def clickMe(self): self.action.configure(text='Hello ...

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