Thanks so much Neil .. my problem is kinda different though ..
see i have a char** which is an array of strings that i want the list to
display. but i want each list item to be displayed with a bitmap by its
side. thats why i decided to use the LstSetDrawFunction.
This is the gist of what i'm doing ..
static char** str; // contains an array of strings which the
list has to display]
static int currItem = 0;
int n = 0; // has the number of strings in str
static void InitTestList(ListPtr lst)
{
LstSetListChoices(lst, str, n);
LstSetDrawFunction(lst, (ListDrawDataFuncPtr) myDrawFunction);
LstDrawList(lst);
}
static void myDrawFunction (UInt16 itemNum, RectanglePtr bounds, char
**itemsText)
{
struct _opaque* theResourceHandle;
BitmapPtr theBitmapPtr;
int x = bounds->topLeft.x, y = bounds->topLeft.y;
theResourceHandle = DmGetResource(bitmapRsc, bmpTestBitmap);
theBitmapPtr = MemHandleLock( theResourceHandle );
WinDrawBitmap (theBitmapPtr, x, y);
MemHandleUnlock( theResourceHandle );
DmReleaseResource( theResourceHandle );
WinDrawChars (itemsText[currItem], StrLen(itemsText[currItem]), x+15,
y);
currItem++;
}
very obviously .. when the user scrolls the list, currItem keeps on getting
incremeneted & then the function references unallocated memory & my
application goes for a toss. i'm quite sure there is another way to do this.
any help would be greatly appreciated.
thanks a whole lot in advance ..
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/