-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Updating items in the list #65
Comments
I've made some progress here:
and
This should work, however, I'm encountering an empty list instead of a populated one. I can also confirm that
|
With a friend's help I figured out that I shouldn't be calling listboxvar or update_listbox, but just inserting and deleting items like normally. So I've come back to this configuration:
with these helper functions:
however, the behavior is extremely erratic with the analysis clicked sometimes being deleted and never re-added, sometimes another sample's name is deleted and re-added, etc accompanied by the following errors:
|
Sorry for spamming. I got it working, except for one error when I click on the item in the list:
As for the above code, the solution was to insert but NOT delete:
|
Any idea on the error I'm getting and how I can hide/resolve it?
The behavior is totally fine, everything works as expected, this is just a random error I'm trying to clear. It only occurs when I click on an analysis that I haven't touched yet, if I go back to an analysis that has already been seen/loaded then there's no error. |
I kinda (for me) fixed the error problem by replacing the code line 125 in ctk_listbox.py by : It checks if the selected_button object exists at the time the lamda function is called. (Thanks to GitHub Copilot) |
Although this isn't directly related to your original post, Listbox already handles item selection internally. Instead of using
|
I am relatively new to Python, so reading the source code for this is hard for me. Can you please add an example of how to use update_listvar and listvariable to the documentation? I love the way that this frame looks, but I am trying to update the text content of a list item in place and running into errors when I try to delete and re-insert the item.
Basically, I am writing mass spectrometry data reduction software and I want to give the user a list of samples in the sequence, preceded by a ☐ when the data has not been reduced, and a ☑ when the data has been reduced. Also, if the user clicks on a sample in the list, the other frames should be updated to show that sample's data.
This is the function giving me trouble:
The text was updated successfully, but these errors were encountered: