How to do it...

Let's see how to perform this recipe:

  1. To use multiple notebooks within the same GUI, we start by creating two frames. The first frame will hold the notebooks and their tabs while the second frame will serve as the display area for the widgets each tab is designed to display.
  2. Create a new module: GUI_Complexity_end_tab3_multiple_notebooks.py.
  3. Add the following code:
import tkinter as tkfrom tkinter import ttkfrom tkinter import scrolledtextfrom tkinter import Menufrom tkinter import Spinboxfrom tkinter.messagebox import showinfo
  1. Create callback functions:
def clickMe(button, name, number):    button.configure(text='Hello {} {}'.format(name.get(),     number.get()))def clearScrol(scr):    scr.delete('1.0', tk.END) def _spin(spin, ...

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.