-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ttk.Treeview.insert() does not allow to insert item with "False" iid #77277
Comments
ttk.Treeview.insert(... iid=None, ...) method has a check: Documentation says that "If iid is specified, it is used as the item identifier", but as you can see from code, iid is used only if it's "True". It means that you cannot use iids like 0, 0.0 etc. |
This was initially reported in pydev thread "ttk.Treeview.insert() does not allow to insert item with iid=0" on 2018/3/16. Igor, you should have mentioned on the thread that you had opened a tracker issue in response. It was only happenstance that I did not open a duplicate. I suggested there that 'if iid:' be replaced by 'if iid is not None:' but wondered if passing '"-id" ""' in the tk.call would be a problem. If so, that would be a reason for the expanded check and suggest 'if iid in (None, ''):" as the replacement. MRAB responded that '' is the id of the root of the tree. But that does not tell me if passing a duplicate iid or that particular duplicate is a problem or not. |
I have tested -- omitting the option and passing an empty string are treated different in Tk. Passing a duplicate iid is error. Thus the fix should be just |
I made the changes on my machine and I\in my testing, it breaks on an empty string with an error saying |
Yes, this is expected. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: