Akascape / CTkListbox

A simple listbox for customtkinter (extenstion/add-on)
MIT License
130 stars 14 forks source link

Issues updating the value list. #30

Closed TheVengefulSpirit closed 6 months ago

TheVengefulSpirit commented 7 months ago

Heya, I am having quite an odd bug with the list box.

I know it is probably not your doing and it is just me being dumb but when using a function to update the list box, it causes it to not update but just stay as it is. The odd thing is, I can call a variable that is meant to be there and it tells me that it is there and fine.

The code is quite simple as of now but here is the part where it should be doing it.

def add_url(self, addurl):
    print("add function called")
    print(addurl)
    self.URLlist.insert("end", str(addurl))
    self.URLlist.after(10, self.update_list)  # Force an update of the listbox
    print("added url")
    testprint = self.URLlist.get(2)
    print("the third item isx",testprint)

def update_list(self):
    print("list update called")
    self.URLlist.update()
    self.URLlist.update_idletasks()
    print("list update complete")

This is the output I get in a terminal

add function called test added url the third item is test list update called list update complete

But then this is what I see inside the app.

image

I find it quite odd that it can add the item, see the item on a base level but can't display it in the list. If ya got any suggestions, feel free to shoot them my way!

Thanks for reading this if you do <3

Akascape commented 6 months ago

@TheVengefulSpirit Not facing this issue, make sure you are using the latest version.

self.URLlist.insert("end", str(addurl)) maybe your addurl is None

Akascape commented 6 months ago

@TheVengefulSpirit Please try the new version, I guess it is fixed now.