Akascape / CTkListbox

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

support for .index(option) #46

Closed BhagyaJyoti22006 closed 4 months ago

BhagyaJyoti22006 commented 5 months ago

How can I know the index of a given option in the listbox, if it exists. I have an option which is selected. Now, I want to select the option just below it and just above it. I could do it if i know its index. Index can be obtained by any external loops. I was wondering if there is any pre-built function, or do you have anything in mind?

BhagyaJyoti22006 commented 5 months ago

Note: I know curselection exists. But it only returns the selected indexes. I want that it returns index of the input string. And return None if it doesnt exist.

Akascape commented 4 months ago

@BhagyaJyoti22006 Use .get(index) method

BhagyaJyoti22006 commented 4 months ago

Thanks mate!