Hello,

I found a possible bug with ttk.Treeview widget. 
I'm working on program that uses tkinter UI. I use ttk.Treeview to display some objects and I want to use integer iid of items.
For example, I insert a row with treeview.insert(... iid=0, ...). But I encountered a problem when I try to get this item from treeview by iid when iid =0.
There is no item with such iid. This item has autogenerated iid just like it's not specified.
I investigated problem and found that in ttk.py, Treeview.insert(... iid=None, ...) in method's body has a check:
        if iid:
            res = self.tk.call(self._w, "insert", parent, index,
                "-id", iid, *opts)
        else:
            res = self.tk.call(self._w, "insert", parent, index, *opts)
It means that if iid is "True" then use it else autogenerate it.
Maybe there should be "if iid is not None", not "if iid"? Or there are some reasons to do check this way?

Igor Yakovchenko

Без вирусов. www.avast.ru