title: ttk.treeview selection_set to the item with specific id
body: <p>I want to edit an item in treeview by another Toplevel window and after editing want to refresh / reload items into list from database and set focus to the edited item.
  The problem I am facing is to SET FOCUS TO THE EDITED ITEM IN TREEVIEW. Any help will be appreciated.
  Here is the minimal sample code.</p>
  <pre><code>    import tkinter as tk
      from tkinter import ttk
  
      class _tree(tk.Frame):
          def __init__(self, *args):
              tk.Frame.__init__(self, *args)
              self.tree = ttk.Treeview(self, columns = (&quot;id&quot;, &quot;name&quot;))
              self.tree.heading(&quot;#0&quot;, text = &quot;s.n&quot;)
              self.tree.heading(&quot;#1&quot;, text = &quot;id&quot;)
              self.tree.heading(&quot;#2&quot;, text = &quot;name&quot;)
              self.tree.pack()
              _items = [[52,&quot;orange&quot;],[61,&quot;manggo&quot;],[1437,&quot;apple&quot;]] # item with id 61 needs to be changed
              sn = 1
              for r in (_items):
                  self.tree.insert(&quot;&quot;, &quot;end&quot;, text = str(sn), values = (r[0], r[1]))
                  sn += 1
              self.tree.bind(&quot;&lt;Double-Button-1&gt;&quot;, self._item)
  
          def _item(self, event):
              global item_values
              global item_id
              global item_name
              idx = self.tree.selection()
              item_values = self.tree.item(idx)
              print(&quot;item_values : %s&quot; % item_values)
              item_id = self.tree.set(idx, &quot;#1&quot;)
              item_name = self.tree.set(idx, &quot;#2&quot;)
              edit_item(self)
      class edit_item(tk.Toplevel):
          def __init__(self, master, *args):
              tk.Toplevel.__init__(self, master)
              self.master = master
              global item_values
              global item_name
              lbl1 = tk.Label(self, text = &quot;item name&quot;)
              self.ent1 = tk.Entry(self)
              btn1 = tk.Button(self, text = &quot;update&quot;, command = self.update_item)
              lbl1.place(x=0, y=10)
              self.ent1.place(x=90, y=10)
              btn1.place(x=90, y=100)
              self.ent1.insert(0, item_name)
          def update_item(self):
              for i in self.master.tree.get_children():
                  self.master.tree.delete(i)
              new_data = [[52,&quot;orange&quot;],[61,&quot;mango&quot;],[1437,&quot;apple&quot;]] # item with id 61 has been changed
              sn = 1
              for r in (new_data):
                  self.master.tree.insert(&quot;&quot;, &quot;end&quot;, text = str(sn), values = (r[0], r[1]))
                  sn += 1
              # Need to set focus on item with id 61 
              idx = self.master.tree.get_children(item_values['values'][0]) # HERE  NEED  HELP
              self.master.tree.focus_set()
              self.master.tree.selection_set(idx)
              self.master.tree.focus(idx)
              self.destroy()
      def main():
          root = tk.Tk()
          app = _tree()
          app.pack()
          root.mainloop()
  if __name__ == &quot;__main__&quot;:
      main()
  
  `
  
  I am receiving the following error:
  Exception in Tkinter callback
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.8/tkinter/__init__.py&quot;, line 1883, in __call__
      return self.func(*args)
    File &quot;test_tree.py&quot;, line 55, in update_item
      idx = self.master.tree.get_children(item_values['values'][0]) # HERE  NEED  HELP
    File &quot;/usr/lib/python3.8/tkinter/ttk.py&quot;, line 1225, in get_children
      self.tk.call(self._w, &quot;children&quot;, item or '') or ())
  _tkinter.TclError: Item 61 not found
  
  </code></pre>