title: Tkinter - Selecting an item from a Treeview using single click instead of double click (Callback on Treeview item selection)
body: <p>When you want to select an item in a Treeview, you usually use the double-click:</p>
  
  <pre><code>def print_element(event):
      print(my_treeview.selection()[0])
  my_treeview.bind("&lt;Double-1&gt;", print_element)
  </code></pre>
  
  <p>Today I tried to do the same but using a single click instead:</p>
  
  <pre><code>my_treeview.bind("&lt;Button-1&gt;", print_element)
  </code></pre>
  
  <p>But it wouldn't work. The output was just an empty tuple.
  I started to search online for an explanation... why is it not working?</p>
  
  <p>EDIT:
  My goal was actually to <code>do something</code> every time a treeview item was selected. </p>
  
  <ul>
  <li>I proposed a solution myself using the <code>identify()</code> function of Tkinter</li>
  <li>Another user proposed to use the Tkinter callback <code>&lt;ButtonRelease-1&gt;</code> which is much more appropriate</li>
  <li>Finally, a third user focused his answer on using the Tkinter callback <code>&lt;&lt;TreeviewSelect&gt;&gt;</code>, which is for sure the best option</li>
  </ul>