Cherlene Lim wrote:
> I have some problem in getting to display the selector trigger label
>with the value that I wanted.
Here's a snippet of code that works for me:
// a global string variable to hold the label
char gSelectorTriggerLabel[255]; // Max length of label is 255
characters: plenty!
void ChangeControlLabel( UInt16 controlID )
{
FormPtr frmP;
ControlPtr contP;
// Get the pointer to the control
frmP = FrmGetActiveForm();
contP = (ControlPtr)FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
objectID));
// Set the label
CtlSetLabel( contP, gSelectorTriggerLabel );
}
CtlSetLabel doesn't make a copy of the string you pass in, so you need to
make sure that it is never deleted (that's why I use a global above).
Alternatively, you can use CtlGetLabel to get the original string and
change it "in place", but if you do that you need to make sure you never
make it longer than it was originally. If you do it that way, make the
string very long in constructor.
Dave
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html