title: Python TK Notebook tab change check
body: <p>Newbie programmer here. I am building a tk based desktop app and ran into an issue:</p>
  
  <p>I have a main window with several stuff in it including two tabs:</p>
  
  <pre><code>    global nBook
      nBook = ttk.Notebook(self, name="book")
      nBook.place(x=300,y=400)
      frameOne = ttk.Frame(nBook, width=100, height=100)
      frameTwo = ttk.Frame(nBook, width=100, height=100)
      nBook.add(frameOne, text='T1')
      nBook.add(frameTwo, text='T2')
      frameOne.bind("&lt;&lt;NotebookTabChanged&gt;&gt;", self.routine())
      frameTwo.bind("&lt;&lt;NotebookTabChanged&gt;&gt;", self.routine())
  </code></pre>
  
  <p><strong>routine()</strong> is a function that SHOULD perform a check <strong>every time T2 is selected</strong></p>
  
  <pre><code>def routine(self):
      if str(nBook.index(nBook.select())) == "2":
          # Do stuff
      else:
          pass
  </code></pre>
  
  <p>Problem is that it doesn't do anything when the tab is changed except for calling the routine function as soon as I open the app and never again. I just can't figure out what I'm doing wrong. </p>
  
  <p>Could anyone point out the mistake(s) I'm making?</p>
  
  <p>EDIT: Same issue if I try </p>
  
  <pre><code>nBook.bind("&lt;&lt;NotebookTabChanged&gt;&gt;", self.xbRoutine())
  </code></pre>