Page 1 of 1

Populating listboxes should be done without intermediate upd

Posted: 2007-02-26, 12:15 UTC
by now
When populating listboxes, constantly updating the display really slows down the whole interaction. It also looks weird when the scrollbar “shoots upwards”. The following article has some coverage on how to avoid it:

http://blogs.msdn.com/oldnewthing/archive/2004/06/10/152612.aspx

And even if it’s suggested that this only matters for hundreds of items, I think you’ll see improvements with far less items in the list.

Posted: 2007-02-27, 11:36 UTC
by wanderer
Well, i don't know if Christian will use it but it is certainly helpful to me. I have used LockWindowUpdate in some of my apps. Thanks for the info.

Posted: 2007-02-27, 22:02 UTC
by ghisler(Author)
Hmm, I'm already setting redraw to false in the file panels...

Posted: 2007-02-27, 22:05 UTC
by Lefteous
2ghisler(Author)
Do you also do this in the tree panels? It seems to me that deleting many directories in a bunch leads to many refrehes.

Posted: 2007-02-27, 22:08 UTC
by ghisler(Author)
I do it separately for each added branch. I'm not sure about deleting, I will check it.

Posted: 2007-02-27, 22:37 UTC
by wanderer
2 now:
Configuration\Options\Refresh: Maybe this is turned on? Try turning it off, then restart TC (i think it's necessary).

Posted: 2007-02-28, 09:22 UTC
by now
Argh! Please excuse my terrible introduction. What I meant was for other listboxes like the “Choose command” dialogs listboxes, or the start menu editor. Really sorry about not being clear. It’s of course very clear to me what I mean, but I sometimes don’t realize that it isn’t going to be clear to other people.

Posted: 2007-03-02, 10:34 UTC
by ghisler(Author)
I see - I don't use it in these cases because there are only a few items, so it's not time-critical. With file lists, there can be several 10'000 items, which would take much longer when redrawing isn't turned off.

Posted: 2007-03-02, 13:58 UTC
by now
Yeah, that's true. But you still get that very annoying shooting-scrollbar effect and you can tell that the whole dialog is in pains over the listbox being updated so heavily. Anyway, it's just another one of those interface things I like to complain about...do with it as you will.