Thanks, Dave. I replaced my Label controls with Fields (non-editable) and
changed the code to copy the new string to a global buffer (one per field)
and then called FldSetTextPtr() and FldDrawField(). Works much better.
From: Dave Lippincott <[EMAIL PROTECTED]>
> Instead of using a label use a field & set it for read-only. The other
> method I use is a gadget (to get the coordinates) and have your app use
> WinEraseRectangle and WinDrawChar to update the 'label'
> I tend to avoid labels if there is a chance I may need to change the text.
>
> From: Marty Rice <[EMAIL PROTECTED]>
> >In a form's event handler, I'm trying to respond to a control selection
by
> >changing another control's label (the target is just a label). I copy
the
> >new string into the control's ::text member and call CtlSetLabel like
this:
> >
> >ControlPtr pCtl = GetObjectPtr(res_id);
> >StrCopy(pCtl->text,"new string");
> >CtlSetLabel(pCtl,pCtl->text);
> >
> >This function works fine when called from the form's Init function, but
not
> >when I call it from the event handler (the string doesn't change at all).
> >If I force the entire form to redraw, using FrmDrawForm(), then the new
> >string is shown, but if it is shorter than the original string, some of
the
> >original text is still shown (like it just drew the new string on top of
> the
> >old one). I've made sure that the string originally defined for the
> control
> >in Constructor is longer than the string I am copying into it later.
> >
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html