ListBox speedup - advices ?

[quote=159184:@Rob Egal]I am developing a database app and need to show the user the result of the db query which
could sometimes come down to 300 rows and >10 columns.
Xojo built on listbox control is ok but not really smooth and so I am wondering what I can do to
improve scrolling/showing the table AND how can I do this code wise ?[/quote]

Another trick is to set ScrollBarVisible to false before calling your addrow subroutine (I load from a dictionary FWIW). I have a single column listbox containing >12,000 rows that’s dynamically filtered through a textfield, and the listbox response on Mac/Win is near instant. The difference is significant with this slight change.

That’s interesting as I usually do LB.visible= false to speed up the display. That sure helps but introduces flicker issues. Have to check if just saying ScrollBarVisible=false is equally effective.

The focus-ring issue is VERY remarkable on retina displays. Makes ‘bigger’ lists close to useless. (They are not that big, actually.)

Guys, have you added the bug report to your top cases? I know I did …

Instead of a focus ring, one can place under the listbox a blue rectangle 4 pixels wider and taller, centered relative to the LB, and switch its visibility when needed.

[quote=159675:@Michael Diehr]Slow listbox in OSX? I reported this bug a while back - I think it’s not been fixed yet:
<https://xojo.com/issue/26903>

Workaround : disable the FocusRing.

If anyone notices this is still a problem in 2014 R3.2 - please update the feedback case.[/quote]

I once reported this for listboxes, here (merge them?)
<https://xojo.com/issue/26924>

I’ve worked my way through the xojo listbox and after spending some time I could find out that the usage of drawstring with condense slows down scrolling heavily. I’ve reported this but it seems also an OSX issue.
I tried some primitive functions from NSString->draw but is was also slow, slower than drawstring.

I’ve finally decided to cache listbox cells in a dictionary to help avoid drawing always the same stuff without any changes
an so I ended up with an awesome listbox speed. In my example I used over 300 rows and about 18 columns. Scrolling is perfectly smooth. Memory Usage is about 100mb for it but you can contrain it of course internally by limited cached items.

Basic and simple idea->great improvment.