>Is there a way to find out the top item in a list (i.e. the index of the
>item that is currently displayed as the top item) without looking at the
>topItem member of the ListType structure? Since we've been warned not to
>assume that structure contents will stay the same, I'm trying to obey, but I
>haven't found a work-around for this one.
I just ran across this myself recently and discovered this work-around:
If you use a list callback function, I've found that you can
intercept the draw for the _second_ item in the list and save the
item # -1. You can't use the 1st item in the list because the redraw
code for the scroll arrows in the OS redraws the last item as the
first item without calling the callback. Here's some code:
static void MainFormDrawListItem
(
Int16 itemNum, // ( in ) item number to draw
RectanglePtr boundsP, // ( in ) place to draw it
Char ** /* itemText */
)
{
if ( boundsP->topLeft.y == 42 )
topItem = itemNum - 1;
Hope that helps.
Regards,
Steve Mann
--
-------------------------------------------
Creative Digital Publishing Inc.
1315 Palm Street, San Luis Obispo, CA 93401-3117
-------------------------------------------
805.784.9461 805.784.9462 (fax)
[EMAIL PROTECTED] http://www.cdpubs.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/