title: Submit button for entry widget within Frame class tkinter not working
body: <p>I am attempting to save entries from user inputs through TKinter. My current GUI has several pages, and I am making a Submit button to capture the input. However, when running the below code, I do not receive an error, but the route submit function does not work - neither does it add the entries to the Routes_dict dictionary, nor does it clear the entry widget fields.</p>
  <p>I am unsure why this is so - I am currently using <code>self</code> as an argument of <code>routesubmit</code> so that <code>self.e1.get()</code> refers to the entry widget, but it appears that this is no working. Below is the relevant code, omitting the superfluous frames. Any advice on making the function <code>routesubmit</code> perform the desired task of gathering entry values and creating a dictionary entry for this frame would be much appreciated.</p>
  <p>I tried writing <code>routesubmit</code> as a method of <code>InputPage</code>, but this did not appear to work either. Thank you for the help!</p>
  <pre><code>import tkinter as tk  # python 3
  from tkinter import font as tkfont  # python 3
  from RouteDataClass import *
  import pickle
  
  
  def quitwindow():
      print(&quot;program terminating...&quot;)
      filename = &quot;ARN_Routes_Database_File.txt&quot;
      file = open(filename, 'wb')
      pickle.dump(Routes_dict, file)
      exit()
  
  
  def routesubmit(self): # self is passed as an argument to allow the .get() functions to be performed
      route_id_var = self.e1.get()
      origin_var = self.e2.get()
      destination_var = self.e3.get()
      length_var = self.e4.get()
      loadtype_var = self.e5.get()
      customer_var = self.e6.get()
      self.e1.delete(0, 'end')
      self.e2.delete(0, 'end')
      self.e3.delete(0, 'end')
      self.e4.delete(0, 'end')
      self.e5.delete(0, 'end')
      self.e6.delete(0, 'end')
  
      Routes_dict[route_id_var] = Route(route_id_var, origin_var, destination_var, length_var, loadtype_var, customer_var)
  
  
  class myGUI(tk.Tk):
  
      def __init__(self, *args, **kwargs):
          tk.Tk.__init__(self, *args, **kwargs)
  
          self.title_font = tkfont.Font(family='Helvetica', size=18, weight=&quot;bold&quot;, slant=&quot;italic&quot;)
  
          # the container is where we'll stack a bunch of framescon top of each other, then the one we want visible will be raised above the others
          container = tk.Frame(self)
          container.grid_rowconfigure(0, weight=1)
          container.grid_columnconfigure(0, weight=1)
          container.grid(row=0, column=0)
  
          self.frames = {}
          for F in (StartPage, Input_Page):
              page_name = F.__name__
              frame = F(parent=container, controller=self)
              self.frames[page_name] = frame
  
              # put all of the pages in the same location; the one on the top of the stacking order will be the one that is visible.
              frame.grid(row=0, column=0, sticky=&quot;nsew&quot;)
  
          self.show_frame(&quot;StartPage&quot;)
  
      def show_frame(self, page_name):
          &quot;&quot;&quot;Show a frame for the given page name&quot;&quot;&quot;
          frame = self.frames[page_name]
          frame.tkraise()
  
  
  class StartPage(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          self.controller = controller
          self.rowconfigure(6, weight=1)
          self.columnconfigure(3, weight=1)
          label = tk.Label(self, text=&quot;ARN Entry &amp; Analysis Widget&quot;, font=controller.title_font)
          label.grid(row=0, column=1, sticky=tk.EW, pady=5, padx=5)
  
          button1 = tk.Button(self, text=&quot;Enter a new ARN route&quot;,
                              command=lambda: controller.show_frame(&quot;ARN_Input_Page&quot;))
          button1.grid(row=1, column=1, sticky=tk.W)
  
          button2 = tk.Button(self, text=&quot;Add a stopping point to an existing route&quot;,
                              command=lambda: controller.show_frame(&quot;ARN_AddPoint_Page&quot;))
          button2.grid(row=2, column=1, sticky=tk.W)
  
          button3 = tk.Button(self, text=&quot;Analyze an ARN route&quot;,
                              command=lambda: controller.show_frame(&quot;ARN_Analysis_Page&quot;))
          button3.grid(row=3, column=1, sticky=tk.W)
  
          button4 = tk.Button(self, text=&quot;Edit an ARN route&quot;,
                              command=lambda: controller.show_frame(&quot;ARN_Edit_Page&quot;))
          button4.grid(row=4, column=1, sticky=tk.W)
  
          button5 = tk.Button(self, text=&quot;Quit&quot;)
          button5.grid(row=5, column=1, sticky=tk.SE, pady=10, padx=10)
          button5.bind('&lt;Button-5&gt;', quitwindow)
  
  
  class Input_Page(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          self.controller = controller
          self.rowconfigure(6)
          self.columnconfigure(0, weight=1)
          self.columnconfigure(1, weight=3)
  
          route_id_var = tk.StringVar()
          origin_var = tk.StringVar()
          destination_var = tk.StringVar()
          length_var = tk.StringVar()
          loadtype_var = tk.StringVar()
          customer_var = tk.StringVar()
  
          title = tk.Label(self, text=&quot;New Route Input&quot;, font=controller.title_font)
          title.grid(row=0, sticky=tk.EW)
  
          tk.Label(self, text=&quot;Route ID&quot;).grid(row=1, column=0)
          self.e1 = tk.Entry(self, textvariable=route_id_var)
          self.e1.grid(row=1, column=1)
  
          tk.Label(self, text=&quot;Origin&quot;).grid(row=2, column=0)
          self.e2 = tk.Entry(self, textvariable=origin_var)
          self.e2.grid(row=2, column=1)
  
          tk.Label(self, text=&quot;Destination&quot;).grid(row=3, column=0)
          self.e3 = tk.Entry(self, textvariable=destination_var)
          self.e3.grid(row=3, column=1)
  
          tk.Label(self, text=&quot;Node-Node Length&quot;).grid(row=4, column=0)
          self.e4 = tk.Entry(self, textvariable=length_var)
          self.e4.grid(row=4, column=1)
  
          tk.Label(self, text=&quot;Load Type&quot;).grid(row=5, column=0)
          self.e5 = tk.Entry(self, textvariable=loadtype_var)
          self.e5.grid(row=5, column=1)
  
          tk.Label(self, text=&quot;Customer&quot;).grid(row=6, column=0)
          self.e6 = tk.Entry(self, textvariable=customer_var)
          self.e6.grid(row=6, column=1)
  
          quit_btn = tk.Button(self, text='Quit', command=quitwindow)
          quit_btn.grid(row=10, column=1, sticky=tk.E, pady=4)
  
          start_btn = tk.Button(self, text=&quot;Go to the start page&quot;, command=lambda: controller.show_frame(&quot;StartPage&quot;))
          start_btn.grid(row=10, sticky=tk.W, pady=5, padx=5)
  
          submit_btn = tk.Button(self, text=&quot;Submit Route&quot;, command=routesubmit(self))
          submit_btn.grid(row=8, column=1, sticky=tk.EW)
  
  if __name__ == &quot;__main__&quot;:
      file = open(&quot;ARN_Routes_Database_File.txt&quot;, 'rb')
      Routes_dict = pickle.load(file)
      app = myGUI()
      app.mainloop()
  </code></pre>