Closed peterjschroeder closed 7 years ago
I figured it out. Besides setting items, set_lines must also be set to the new items.
It looks like ListBox could use a custom redraw function like some of the rest of them. The cursor isn't reset either which causes the new ListBox list to error out if the cursor was on a higher line than the bottom line of the new. If I try to reset the cursor manually by setting to 0, it will work some times but still errors sometimes.
By setting top_line, cur_line, and row to 0, this allows a Listbox to be updated and not crash when new items are set.
Modifying the items in a ListBox, even when calling a changed and redraw on it doesn't update the items in the list.
Example:
Create a DropDown list to filter the ListBox
Create the ListBox
When the DropDown is changed, filter the ListBox based on the selection