tempelmann / XojoListboxTV

Xojo Listbox class for macOS that uses the native NSTableView / NSOutlineView classes. Requires MBS Plugins
2 stars 0 forks source link

Cells momentarily show value from stale ListDrawCellHandler #1

Closed sushpa closed 5 years ago

sushpa commented 5 years ago

In ListBoxTV.dataCell:

// We return a custom NSTextFieldCell, in order to perform some custom painting in its drawWithFrame event handler.
// We are lazy and re-use the same cell, because we keep getting this event called for each drawn cell, sequentially.
static cc As ListBoxTV_Support.ListDrawCellHandler

This works fine usually, but when collapsing or expanding a row in the outline view, all cells show the same value for a split second for as long as the collapse/expand animation is ongoing.

Changing to

dim cc As ListBoxTV_Support.ListDrawCellHandler

Solves the issue, and the repeated allocation isn't a huge performance hit (for a moderate-sized list).

This only applies for a hierarchical list, as far as I can tell.

tempelmann commented 5 years ago

Alright. Can I get a pull request for that, please? Oh, I see you have not made a fork. Ok, I'll do it myself, then.

sushpa commented 5 years ago

Thanks! Yes, I'd do it if I could, but I'm on Xojo lite and can't save to rbp.