This is how I set up text in a field:

static void uiSetText(FormPtr frm, Word fID, CharPtr fData, ULong fSize)
{
  Word fldIndex = FrmGetObjectIndex(frm, fID);
  FieldPtr fld = (FieldPtr) FrmGetObjectPtr(frm, fldIndex);
  VoidHand fieldHandle = MemHandleNew(fSize);
  VoidPtr  fieldData = MemHandleLock(fieldHandle);
  StrCopy((CharPtr) fieldData, fData);
  MemHandleUnlock(fieldHandle);
  FldSetTextHandle(fld, (Handle) fieldHandle);
}

and the calling funtion is:

  uiSetText(frm, MainDesc1Field, "Empty", UD_MAX_ALARM_DESC+1);


In fact, I have the uiSetText() working for a while (in other applicatins).
It even works well on another form of the same application! May there be
a chance other attribute(s) of a form will affect whether a field is
editable?

Thanks
horace

-----Original Message-----
From: David Fedor [mailto:[EMAIL PROTECTED]]
Sent: 1999 Aug 25 Wed 04:29
To: [EMAIL PROTECTED]
Subject: Re: Is a field editable?


Have you set a maximum length for the contents of the field?  That'd also
stop input, if the existing text has already filled up what you said was
the maximum.

(And did you give the field a handle to edit, or just a pointer? If you
just gave it a pointer, it can't resize it, so that'd also have the same
effect.)

-David Fedor
Palm Developer Support




Reply via email to