At 11:14 AM -0700 5/27/99, Sudipta Ghose wrote:
>I don't get it! Using a custom draw procedure, how do I associate additional
>data with a list item? In tables I can use TblSetRowID. Other than using an
>external array/data structure, I can't think of anything. Is there any other
>way?
Good point. Lists don't provide any additional slots for data, so the only
thing you can do is use the "text" pointer.
The good news is that if your list has a custom draw procedure, then the
list code itself won't do anything with the pointer except pass it to your
routine, so you can put pretty much anything in there. (Anything you can
cast to a character pointer, that is.)
>The sources in my SDK says it as a table!
You're right, it is. Sorry about that.
There is another wrinkle... if you use a list, the entire array of "items"
has to be available. For short lists, that's not a problem. For lists of
hundreds of items, that can be a significant chunk of memory.
Of course, you can always do what the tables do and just keep one screen
full of data around, then "page" the records in and out yourself.
On second thought, tables are probably more convenient for doing that sort
of thing, since they manage invalidating and redrawing rows for you.
Sorry for the misguided message.
--Bob