title: Tkinter bind mouse clicks to frame
body: <p>I must be missing something obvious, I have two frames in my Tkinter program, each with a bunch of labels in a grid layout. I want to bind the mouseclick to one of them but not the other. I currently use</p>
  
  <pre><code>root.bind("&lt;Button-1&gt;", mouse_function)
  </code></pre>
  
  <p>but that also triggers if I click in the other frame. I assumed that using</p>
  
  <pre><code>schedule_frame.bind("&lt;Button-1&gt;", mouse_function)
  </code></pre>
  
  <p>would work but then I get no response anywhere.</p>
  
  <p>The function I am calling is:</p>
  
  <pre><code>def mouse_function(event):
      y = event.widget.grid_info()['row']
      x = event.widget.grid_info()['column'] 
      widgets[(y, x)].configure(state="active")
      shiftSelection(y,x)
  </code></pre>