> Would somebody be so kind as to tell me the proper way to programatically
> change the text on a push button (or other controls for that matter). I'm
> trying something like shown below, but sometimes it works and sometimes it
> crashes.
>
> ControlPtr pCtl;
> CharPtr pChr;
> pCtl = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
> SomeForm_SomePushButton));
> pChr = CtlGetLabel(pCtl);
> StrCopy(pChr,pSomeOtherText);
> CtlSetLabel(pCtl,pChr);
>
> I understand that the new text (pSomeOtherText) can't be longer than the
> size of the push button's label when created in Constructor (right?), but
> even when the new string is shorter it doesn't always work.
pCtl = FrmGetObjectPtr (etc);
StrCopy (pCtl->text, pSomeOtherText);
CtlSetLabel (pCtl, pCtl->text);
Stephen Best
Bitware Australia
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html