I assume that adding and deleting columns from a listbox is done like:
myListbox.columnCount = myListbox.columnCount + 1
myListbox.columnCount = myListbox.columnCount - 1
I also assume that removing a column will destroy all the data in the cells of that column. Not so it seems:
- window has a 1 col listbox
- add 10 rows and put stuff in each cell
- append a 2nd column, this one needs 100 rows so append an extra 90 blank rows
- fill the cells of the new col with 100 values: everything looks fine
- delete this 2nd most recently added column using myListbox.columnCount = myListbox.columnCount - 1
- hold on, we need that 2nd column after all, but we only need 10 rows in it, not 100, so re-add a 2nd column: myListbox.columnCount = myListbox.columnCount + 1
- now just fill the top 10 cells of this re-added column (I used -ve numbers for illustration in the png below).
What I expected is a listbox with 2 columns, and with data in the top 10 rows of each, what you get instead is this:
As you can see, the previous 90 trailing values arose from the dead. This cannot be normal behavior. I now worry that celltags, columntags, etc also persist, and could now cause big leaks if these variants hold onto large objects.
2019r3 on macOS