Instead of putting a ton of erase/draw/fiddle calls in, to hopefully mask
whatever the root cause is, how about finding out what is causing the
trouble? I'm sure you've tried to figure it out, Richard, but perhaps I
can be of some help.
You could send me the project and I could debug it, but perhaps we could
turn this into a good learning experience instead, if I told you what I'd
do. (You know the aphorism about giving a man a fish which feeds him for a
day, versus teaching him how to fish which feeds him for life...)
I'd first get a nice simple reproducible case (which I presume you already
have), on the emulator. If possible, get your emulator window to not
overlap with your debugger's window. Then I'd set a breakpoint right
before the drawing was to take place, and run the emulator to get there.
Then I'd step through my code, with a breakpoint at the start of my custom
draw routine. That way you can see everything that gets drawn, either by
you or by the list, since *something* is drawing something wrong.
If it turns out that stepping through the code shows that the app-defined
custom drawing routine is drawing incorrectly, well, we're done :-) If
not, take a look at the OS source code for the LstDrawList() to see what
drawing it does. It is quite simple; basically it does some setup and then
calls the callback for each line, and then draws the arrows and inverts the
current selection. So if the corruption happens after the last call to
your callback, but before LstDrawList returns, you can find out why the
up-arrow or down-arrow are weird, or if the current item or its rectangle
are messed up.
Once I verified to my satisfaction that the callback routine was drawing
correctly, I'd have switched to the PalmDebugger, so that I could step
through the end of LstDrawList and find what drawing is causing the
trouble. (And if I didn't have access to the developer source code, or
project, I'd have done everything in PalmDebugger.)
I'd expect that the above would have pinpointed the problem. Give it a
shot, and if you can't figure it out, send it to me directly and I can try
following my own advice to see what I omitted!
-David Fedor
Palm Developer Support