How it works...

In GUI_Complexity_end_tab3_multiple_notebooks.py, we use the grid layout manager to arrange the two frames we are creating, placing one above the other. Then, we create two notebooks and arrange them within the first frame:

Next, we use a loop to create five tabs and add them to each notebook:

We create a callback function and bind the click event of the two notebooks to this callback function. Now, when the user clicks on any tab belonging to the two notebooks, this callback function will be called:

In the callback function, ...

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.