Python GUI Programming Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

After creating a second tab, we moved some of the widgets that originally resided in Tab 1 to Tab 2. Adding tabs is another excellent way to organize our ever-increasing GUI. This is a very nice way to handle the complexity in our GUI design. We can arrange widgets in groups, where they naturally belong and free our users from clutter by using tabs.

In tkinter, creating tabs is done via the Notebook widget, which is the tool that allows us to add tabbed controls. The tkinter notebook widget, like so many other widgets, comes with additional properties that we can use and configure. An excellent place to start exploring additional capabilities of the tkinter widgets at our disposal is the official website:  https://docs.python.org/3.1/library/tkinter.ttk.html#notebook.