You did this:

  LstSetListChoices(lstP, NULL, 5);

So you cannot use LstGetSelectionText().  It won't work, because you told it
(with the NULL above) that there are no strings.  Since you didn't tell it
what the strings are, you won't be able to use LstGetSelectionText() to ask
it what the strings are.  :-)  Probably you should use LstGetListSelection()
to get the index of the selected item, and then you can use that to index
into your ListCountry array of strings.  As mentioned previously, be sure to
handle -1 which means nothing is selected.



"Sean Yang" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I had tried to do these,but it got the same result,:-(
>
> My IDE: cw9, Palm Emulator 3.5, Win2k sp3.
>
> I use LstSetDrawFunction() to draw list.
> // draw list in frmOpenEvent:
>  lstP = (ListPtr) GetObjectPtr(MainCountryList);
>  LstSetDrawFunction(lstP, (ListDrawDataFuncPtr)MainListDrawFunc);
>  LstSetListChoices(lstP, NULL, 5);
>
> static void MainListDrawFunc(UInt16 itemNum, RectanglePtr bounds, Char
> **itemsText)
> {
>  WinDrawChars(ListCountry[itemNum], StrLen(ListCountry[itemNum]),
>            bounds->topLeft.x, bounds->topLeft.y);
> }
>
>
> //ListCountry define:
> Char   ListCountry[5][10] =
>                 {
>                   {"China"},
>                   {"England"},
>                   {"France"},
>                   {"Russian"},
>                   {"American"}
>                 };



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to