I asked about how to set the focus and get the cursor blinking.

"Elia Freedman" <[EMAIL PROTECTED]> said:
> Try setting the field with focus than drawing it.  You shouldn't have any
> problems with that.  There are lots of bugs in setting the field with focus.

This didn't work.  Through lots of experimentation, the only
order I found that works is:
        1) Set the field contents
        2) Draw the form
        3) Set the focus
I.e.:
        FldSetTextHandle(pField, nameH);
        FrmDrawForm(frm);
        FldSetInsPtPosition(pField, 0); 
        FrmSetFocus(frm, FrmGetObjectIndex (frm, objID) ); 

Putting the FrmDrawForm before the FldSetTextHandle or after the
FrmSetFocus seems to not work.

Here is a related question:  I allocate some memory for the field
handle.  When should I release it or is this handled
automatically?
        nameH = MemHandleNew(stringMaxLen + 1); // ** WHEN deallocate THIS
        nameP = MemHandleLock(nameH);
        StrCopy(nameP, oldstr);
        MemHandleUnlock(nameH);
        FldSetTextHandle(pField, nameH);
        ...
Thanks,
Brad Myers

Reply via email to