GUI design using multiple notebooks
In this recipe, we will create our GUI using multiple notebooks. Surprisingly, tkinter
does not ship out of the box with this functionality, but we can easily design such a widget.
Using multiple notebooks will further reduce the complexity discussed in the previous recipe.
Getting ready
We will create a new Python GUI similar to the one in the previous recipe. This time, however, we will design our GUI with two notebooks. In order to focus on this feature, we will use functions instead of class methods. Reading the previous recipe will be a good introduction to this recipe.
How to do it…
In order 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. We use the grid layout manager to arrange the two frames, placing one above the other. Then, we create two notebooks and arrange...