Using FldGetAttributes, FldSetAttributes is OK, but your use of them is not.

You are passing a random pointer into FldGetAttributes rather than a pointer to a FieldAttrType structure

You've got:
  FieldAttrPtr ptrFieldAttr;

     FldGetAttributes(fld, ptrFieldAttr);
     ptrFieldAttr->editable = 0;
     ptrFieldAttr->underlined = noUnderline;
     FldSetAttributes(fld, ptrFieldAttr);

You need:
FieldAttrType fieldAttr;

FldGetAttributes(fld, &fieldAttr);
fieldAttr.editable = 0;
fieldAttr.underlined = noUnderline;
FldSetAttributes(fld, &fieldAttr);

You've only been lucky that it has worked so far.


Neil


On Thursday, April 3, 2003, at 09:56 AM, Jeff wrote:

Thank you all for the many good ideas to choose from... I ended up using
Veronica's suggestion about modifying the attributes of the fields during
the load table callback function and it does exactly what I was hoping, make
the text in the table non-editable. Here is the code frag that solved my
problem for anyone else who might be interested. Thanks again, Jeff.



static Err MyTableLoadDataFuncType(void *tableP, Int16 row, Int16 column, Boolean editable, MemHandle *dataH, Int16 *dataOffset, Int16 *dataSize, FieldPtr fld) { Boolean temp; FieldAttrPtr ptrFieldAttr;

  temp = editable;            // for debug
  if(row < TABLEROWS)
  {
     FldGetAttributes(fld, ptrFieldAttr);
     ptrFieldAttr->editable = 0;
     ptrFieldAttr->underlined = noUnderline;
     FldSetAttributes(fld, ptrFieldAttr);
     *dataH = hdlTableText[row];
     *dataOffset = 0;
     *dataSize = 128;
  }
  return false;
}


Veronica Loell <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Another perhaps better solution is to alter the attributes of the field
object that is created with default settings for the offending cells.
call FldGetAttributes to get your FieldAttrType struct, change the
attributes in question and apply them with FieldSetAttributes.
This of course is done in the load-function.


- Veronica

Michel.P wrote:
The problem with using a label in tables is that it
will always add a colon ':' to the text, so the second
option might be only solution (albeit also a little
more complicated).

Michel.P






--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/



--
Neil Rhodes
Calliope Enterprises, Inc.
1328 Clock Avenue
Redlands, CA  92374
(909) 793-5995
[EMAIL PROTECTED]


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to