How to do it...

Add the following code to our GUI in the create_widgets() method towards the bottom where we created Tab Control 2. The parent of the new widget frame is tab2, which we created at the very beginning of the create_widgets() method. As long as you place the following code physically below the creation of tab2, it will work:

    ###########################################################     def create_widgets(self):         # Create Tab Control        tabControl = ttk.Notebook(self.win)           # Add a second tab        tab2 = ttk.Frame(tabControl)                   # Make second tab visible        tabControl.add(tab2, text='Tab 2')         # Create Manage Files Frame      mngFilesFrame = ttk.LabelFrame(tab2, text=' Manage Files: ')  mngFilesFrame.grid(column=0, row=1, sticky='WE', padx=10, pady=5) ...

Get Python GUI Programming Cookbook - Second 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.