Python 3 tkinter treeview get NAME of selected item
<p>So basically I have <a href="http://i.stack.imgur.com/ZgjPL.jpg" rel="nofollow">this</a> tree:</p>

<p>And I want to have the name of the item selected back by pressing the "aggiungi" button.
For example when I select Pomodori and then press the button I want "Pomodori" back as string, If I select Frutta I want "Frutta" and so on...
I tried with get.children and then tree.set() but I cant get that to work.
How do I do that?</p>

<pre><code>from tkinter import *
from tkinter import ttk

_root = Tk()
_root.resizable(width=FALSE, height=FALSE)

_F_shopItems = Frame(_root)
_F_shopItems.pack(side="left")

_F_treeview = Frame(_root)
_F_treeview.pack(side="left")

_F_bottom = Frame(_root)
_F_bottom.pack(side="bottom")

# ------------------------
# Treeview
_T_listaProd = ttk.Treeview(_F_treeview, height=10)
_T_listaProd.column("#0", width=165)
_T_listaProd.heading("#0", text="Prodotti")
_T_listaProd.config(columns="Prezzi")
_T_listaProd.column("Prezzi", width=75, anchor="center")
_T_listaProd.heading("Prezzi", text="Prezzi (€/Kg)")
_T_listaProd.grid(row=0, column=0)

# Categorie di prodotti
_T_listaProd.insert('', '0', 'Verdura', text='Verdura')
_T_listaProd.insert('', '1', 'Frutta', text='Frutta')
_T_listaProd.insert('', '2', 'Carne', text='Carne')
_T_listaProd.insert('', '3', 'Dolci', text='Dolci')

# Verdura
_T_listaProd.insert('Verdura', 'end', 'V1', text='Insalata Gentile')
_T_listaProd.set("V1", "Prezzi", "0,98")
_T_listaProd.insert('Verdura', 'end', 'V2', text='Cipolla Bianca')
_T_listaProd.set("V2", "Prezzi", "0,98")
_T_listaProd.insert('Verdura', 'end', 'V3', text='Radicchio')
_T_listaProd.set("V3", "Prezzi", "0,98")
_T_listaProd.insert('Verdura', 'end', 'V4', text='Pomodori')
_T_listaProd.set("V4", "Prezzi", "0,98")
_T_listaProd.insert('Verdura', 'end', 'V5', text='Peperoni')
_T_listaProd.set("V5", "Prezzi", "0,98")

# Frutta
_T_listaProd.insert('Frutta', 'end', 'F1', text='Mele rosse')
_T_listaProd.set("F1", "Prezzi", "0,98")
_T_listaProd.insert('Frutta', 'end', 'F2', text='Ciliege')
_T_listaProd.set("F2", "Prezzi", "0,98")

# Dolci
_T_listaProd.insert('Dolci', 'end', 'D1', text='Crostata (Marmellata)')
_T_listaProd.set("D1", "Prezzi", "0,98")
_T_listaProd.insert('Dolci', 'end', 'D2', text='Nutella')
_T_listaProd.set("D2", "Prezzi", "0,98")

# Carne
_T_listaProd.insert('Carne', 'end', 'C1', text='Braciola di Maiale')
_T_listaProd.set("C1", "Prezzi", "0,98")
_T_listaProd.insert('Carne', 'end', 'C2', text='Pancetta')
_T_listaProd.set("C2", "Prezzi", "0,98")
_T_listaProd.insert('Carne', 'end', 'C3', text='Salame')
_T_listaProd.set("C3", "Prezzi", "0,98")

# Scrollbar
_S_listaProd = Scrollbar(_F_treeview, orient=VERTICAL, command=_T_listaProd.yview)
_S_listaProd.grid(row=0, column=1, sticky="nswe")
_T_listaProd.config(yscrollcommand=_S_listaProd.set)
# ------------------------
_T_listaProd.bind('&lt;&lt;TreeviewSelect&gt;&gt;', #To do#)



_B_addItem = Button(_F_bottom, text="aggiungi", command = #To do#)
_B_addItem.pack(side="bottom") 

_main.mainloop()
</code></pre>