Hi,
Im having trouble drawing a list from an array of strings. All examples i
have found use DMGetResource or have some other way of initializing this
array. Here is my Code :
static void MainFormInit(FormPtr frmP)
{
ListPtr listP;
CharPtr *choicesArray;
CharPtr objectDescription;
VoidHand od;
UInt i;
UInt objectCount = 0;
listP = (ListPtr)
FrmGetObjectPtr(frmP,FrmGetObjectIndex(frmP,MainListAreaList));
objectCount = Restaurant.tableCount;
listHandle = MemHandleNew(20 * objectCount);
choicesArray = MemHandleLock(listHandle);
for (i = 0; i < objectCount;i++) {
od = MemHandleNew(5);
objectDescription = MemHandleLock(od);
StrIToA(objectDescription, Restaurant.tables[i].tableID);
choicesArray[i] = StrCat(objectDescription," Table New /0");
MemHandleUnlock(od);
}
MemHandleUnlock(listHandle);
}
// Set the list choices from the array of pointers.
LstSetListChoices (listP, MemHandleLock(listHandle), objectCount);
LstDrawList(listP);
}
Any help cause me to jump for Joy!
thanks
Steve Wanhella - [EMAIL PROTECTED]
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/