From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Grouping widgeting within a tabbed notebook
From the course: Python GUI Development with Tkinter
Grouping widgeting within a tabbed notebook
- [Instructor] A common mechanism for organizing multiple displays in modern GUIs, is the use of tabs. You've probably used tabs in your web browser, to switch between multiple web pages that you have open at the same time. In tk, the notebook widget can be used for that type of navigation. You can add multiple frames, as the pages of a notebook and then switch between which of the those pages is displayed by selecting from the corresponding tabs. I've already imported the tkinter package and the ttk module as well as created a top level root window using the tk constructor. To create a notebook, I'm going to use the Notebook constructor, which is found inside the ttk module. It's spelled with a capital N and I'm going to pass in the parent of the top level root window. Now I'm going to use the Pack geometry manager, add it to my window. You can see it here, it's very small because it currently doesn't have anything. So lets create a couple frames to add to our notebook. I name this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.