title: One Combobox, One Button, & Two pages in Tkinter
body: <p>this is a revised post about the same question. Using tkinter, i want to add a button to a frame (FrameFour) that opens up a page when a certain value is selected in a Combobox. For instance, if 1 is selected and the button is clicked, then frameOne should open, if two is selected and the button clicked, then frameTwo should open. The code i have for  FrameFour is as below</p>
  
  <pre><code>class PageFour(tk.Frame):
  
  def __init__(self, parent,controller):
      tk.Frame.__init__(self,parent)
  
      self.InitUI()
  
  def nextButton(self,controller):
      if self.mychoice.get()=='1':
          controller.show_frame(PageTwo)
  
  def InitUI(self):
      self.mychoice=StringVar()
  
      self.combo = ttk.Combobox(self,width =15, textvariable=self.mychoice)
      self.combo['values']=(" ","1","2")
      self.combo.grid(column=1, row=0)
      self.label=ttk.Label(self, text="How many files do you want to Process?")
      self.label.grid(column=0, row=0)
  
  
      self.button=ttk.Button(self, text="Next",command=self.nextButton)
      self.button.grid(column=1, row=1)
  </code></pre>
  
  <p>app = GUI_ATT()
  app.mainloop()</p>
  
  <p>but now i get the error message "TypeError: nextButton() missing 1 required positional argument: 'controller'" when i run the code. All the other pages work well and link to each other correctly. 
  Pls let me know if you require more information.</p>
  
  <p>Cheers</p>