В доках пишут, что через move, но как не понимаю совершенно. Вот код. Буду благодарен, если кто напишет функцию и объяснит.
from tkinter import * from tkinter import ttk root = Tk() tree = ttk.Treeview(root) tree["columns"]=("one","two","three") tree.column("#0", width=270, minwidth=270) tree.column("one", width=150, minwidth=150) tree.column("two", width=400, minwidth=200) tree.column("three", width=80, minwidth=50) tree.heading("#0",text="Name") tree.heading("one", text="Date modified") tree.heading("two", text="Type") tree.heading("three", text="Size") # Level 1 folder1=tree.insert("", 1, text="Folder 1", values=("23-Jun-17 11:05","File folder","")) tree.insert("", 2, text="text_file.txt", values=("23-Jun-17 11:25","TXT file","1 KB")) # Level 2 tree.insert(folder1, "end", text="photo1.png", values=("23-Jun-17 11:28","PNG file","2.6 KB")) tree.insert(folder1, "end", text="photo2.png", values=("23-Jun-17 11:29","PNG file","3.2 KB")) tree.insert(folder1, "end", text="photo3.png", values=("23-Jun-17 11:30","PNG file","3.1 KB")) tree.pack() # Спрятать элементы def delete(): selected_item = tree.selection()[0] ## get selected item tree.detach(selected_item) # [b]Вернуть спрятанное[/b] def ret(): # [b]ЧТО ПИСАТЬ ЗДЕСЬ????[/b] pass btnDel = ttk.Button(root, text= 'delete', command = delete) btnDel.pack() btnRet = ttk.Button(root, text= 'return', command = ret) btnRet.pack() root.mainloop()