title: Tkinter entry widget wont take input when using notebook
body: <p>I am trying to get input from an entry widget using Python Tkinter using Notebook. I have managed to get it to work on my main canvas but as soon as I introduced tabs, it would not work. I am clearly missing something linking the .get function to the correct location but I can't work out what. Any ideas?</p>
  
  <pre><code>import tkinter 
  import win32api
  from tkinter import ttk 
  
  checklist = tkinter.Tk()
  
  checklist.title("My Checklist")
  ScreenWidth=checklist.winfo_screenwidth()
  ScreenHeight=checklist.winfo_screenheight()
  checklist.geometry("%dx%d+0+0" % (ScreenWidth, ScreenHeight))
  
  count = 0
  tasks = []
  
  tabcontrol = ttk.Notebook(checklist, width = 500, height = 500)
  tab = ttk.Frame(tabcontrol)
  tabcontrol.add(tab, text = "Checklist Home Page")
  tabcontrol.grid(row = 0, column = 0)
  
  main_canvas = tkinter.Canvas(checklist, width = 1000, height = 1000, highlightbackground="green")
  main_canvas.grid(row=1, column = 0)
  main_canvas.columnconfigure(3)
  main_canvas.rowconfigure(6)
  
  def create_checklist():
          global count
          count += 1
          if count &gt; 10:
              win32api.MessageBox(0, 'Maximum number of checklists made!')
          else:
              tab = ttk.Frame(checklist, width = 500, height = 500)
              tabcontrol.add(tab, text = count)
              tabcontrol.grid(row = 0, column = 0)
              button_add_task = tkinter.Button(tab, text="Add task", width=20, height=1, bg="purple", command=add_task).grid(row = 2, column= 2, pady = (100, 1))
              item_entry = tkinter.Entry(tab).grid(row=6, column =2)    
              list_items = tkinter.Listbox(tab)
              list_items.grid(row =7, column =2, pady=10)
  
  def add_task():
      task = item_entry.get()
      if task !="":
          tasks.append('- ' + task)
          update_listbox()
  
  button_create_checklist = tkinter.Button(main_canvas, text="New Checklist", width=20, height=1, bg = "purple", command=create_checklist).grid(row = 3, column = 2, pady = 1 )
  
  checklist.mainloop()
  </code></pre>
  
  <p>My error is currently:</p>
  
  <pre><code> Exception in Tkinter callback
  Traceback (most recent call last):
    File "C:\Users\lucas\anaconda3\lib\tkinter\__init__.py", line 1705, in __call__
      return self.func(*args)
    File "C:\Users\lucas\OneDrive\Documents\Employability\untitled0999py.py", line 40, in add_task
      task = item_entry.get()
  NameError: name 'item_entry' is not defined
  </code></pre>