Orasanu Iuliana wrote:

I found this code lines on the Palm os Programming Bible:

ListType *list = GetObjectPtr(PopupList);
ControlType *popTrig = GetObjectPtr(PopupTrigger);
Char *label = CtlGetLabel(popTrig);
StrCopy(label, LstGetSelectionText(list,LstGetSelection(list)));
CtlSetLabel(popTrig, label);

this is supose to set the current selection on a PopupTrigger element.
It does this, but it also unables the next selections: when I press the popup 
on my form,the rest of the elements don't apear anymore...
Regards, Iulia



It could be that you are overwriting some memory locations unintentionally. When you use the StrCopy command, you are writing a new string onto the old label location, but if the new string is longer than the ORIGINAL label was (probably set when you defined the popup trigger in your resource file) then you will overwrite the end of the original memory location, and start writing on top of other stuff. Often, the list is defined right after the trigger, so you might be overwriting the beginning of the list structure.

Bob.

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

Reply via email to