Yes, you cannot populate a label with more characters than it was originally allocated for. The workaround is to use an edit field with the read only properly set. Its much safer if you are using a regular label. Since you need to update a trigger control, initialize (or create in constructor) the control with the max number of characters you would ever plan to display. I use to do this by placing one 'X' in the text field for each character. I would also use StrNCopy instead of StrCopy to prevent an accidental over-run of the label.
----- Original Message ----- From: "Ted Pederson" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 1:37 PM Subject: CtlSetLabel > For labels, it seems safer to use FrmCopyLabel(), but you are still > limited to changing the text to a string that is the same or less length > than the original string in the resource. Is this correct? Is there any > way around this? > > On pg. 249 of the Bible, there is the snippet that changes the label of > a popup trigger. It just goes ahead and does a StrCopy() and call > CtlSetLabel(). How can this be safe? > > I would guess there will be enough space allocated for the popup > trigger's label to hold any of the strings in the associated list. But > if you are using LstSetListChoices(), as it says on pg. 249 that it > would be ok to do, what if you allocated a new longer string in the list > ? Wouldn't that cause problems? > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
