title: Calling Tkinter frame controller from function rather then button command
body: <p>So I have the following, which works perfectly:</p>
  
  <pre><code>import tkinter as tk
  
  class App(tk.Tk):
      def __init__(self, *args, **kwargs):
          tk.Tk.__init__(self, *args, **kwargs)
  
          container = tk.Frame(self)
          container.pack(side="top", fill="both", expand=True)
          container.grid_rowconfigure(0, weight=1)
          container.grid_columnconfigure(0, weight=1)
  
          self.frames = {}
          for F in (LoginPage, ProjPage):
              frame = F(container, self)
              self.frames[F] = frame
              frame.grid(row=0, column=0, rowspan=12, columnspan=6, sticky="nsew")
  
          self.show_frame(LoginPage)
  
      def show_frame(self, c):
          frame = self.frames[c]
          frame.tkraise()
  
  class LoginPage(tk.Frame):
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
  
          Btn = tk.Button(self, text="Sign In", command=lambda: controller.show_frame(ProjPage))
  </code></pre>
  
  <p>But I want that last button command to be in a separate function, so I can do some evaluations first:</p>
  
  <pre><code>        Btn = tk.Button(self, text="Sign In", command=self.signIn)
  
      def signIn(self):
          # do some stuff here
          self.controller.show_frame(ProjPage)
  </code></pre>
  
  <p>This doesn't work; regardless if I try to pass the controller, or use a lambda, nothing seems to work >.&lt;
  What am I not getting?</p>