LstSetListChoices does'nt make a copy of the data you pass to it, so you
must write:
void* strs = MemPtrNew(stringcount*sizeof(char*));
for(i=0;i< stringcount)
{
strs[i] = MemPtrNew(stringsize); // adapt this code
MemMove(stringptr,strs[i],stringsize);
LstSetListChoices(list,strs,stringcount);
}
If you're changing the contents of a popup list you may also call
LstSetHeight to adjust the number of visible items.
--
Eric Vergnaud
President of Street Soft
----------
>De�: "Charles Rezsonya" <[EMAIL PROTECTED]>
>� : <[EMAIL PROTECTED]>
>Objet�: Re: LstSetListChoices
>Date�: Ven 8 oct 1999 14:47
>
> what i did on that case, was declare a char blah[10][20]; then l8r in my
> app i did a blah[i] and dropped the other one to assign string elements to
> it. it may be picking on the variables not being established or (written to
> memory),.. i had the problem. but once i got'em put in, i merely called
> the lstSetListChoices and worked. heh, infact i put two dropdown lists in
> the same screen.
>
> -----Original Message-----
> From: Michael McFarland <[EMAIL PROTECTED]>
> To: 'Palm Development List' <[EMAIL PROTECTED]>
> Date: Thursday, October 07, 1999 6:32 PM
> Subject: LstSetListChoices
>
>
>> I'm trying to use a single drop-down list to handle a few different
>>cases, and I'd like to use the function LstSetListChoices to modify the
>>options contained in the list at any point. But neither
>>
>> CharPtr ChoiceArray[4] = {"abc", "def", "ghi", "jkl"};
>> LstSetListChoices( listP, ChoiceArray, 4 );
>>
>> nor
>>
>> LstSetListChoices( listP, {"abc", "def", "ghi", "jkl"}, 4 );
>>
>>are working. The examples I've found thus far either involve using string
>>resources or custom list draw routines, and it seems there should be a
>>simpler, more direct method like I've tried above. Could someone tell me
>>why the above attempts don't work and if there is a simple modification
>>that would make it work?
>>
>> Michael
>>
>
>
>