Aug-11-2023, 12:38 PM
Hello,
I'm trying to make an item search engine in a treeview, if I do it with a button, it works for me.
But I want to do the search without a button, just writing in the entry I select the closest thing.
I have done this, it does not give me any errors or anything, but it does not select any similar item or anything.
I'm trying to make an item search engine in a treeview, if I do it with a button, it works for me.
But I want to do the search without a button, just writing in the entry I select the closest thing.
I have done this, it does not give me any errors or anything, but it does not select any similar item or anything.
self.entry_buscador = tk.Entry() self.entry_buscador.place(x=150, y=142, width=450, height=40)
self.entry_buscador.bind("<<KeyRelease>>", self.buscar)
def buscar(self, event): self.query = self.entry_buscador.get().lower() for item in self.treeview_almacen.get_children(): values = self.treeview_almacen.item(item, "values") if self.query in values[0].lower(): self.treeview_almacen.selection_set(item) self.treeview_almacen.focus(item) self.treeview_almacen.see(item) else: self.treeview_almacen.selection_remove(item)what do i have wrong? what can i do