1)I need to implement a large help screen, essentially an enormous text field that can scroll i guess, like 2000 characters or more. Does anyone have any recommendations as to how I store this text? The only option I see is using a Field and store the text screen in a huge Char *. Labels seem to small to store the text so what else is there?
Lookup MemHandleNew() and FldSetTextHandle()
2)I am trying to set a field with a string and I keep getting memory
errors. I know i am just not allocating the memory properly, could someone show me how to do this properly. I have tried SetFieldTextFromStr as well the error is in how I am allocating the constant string(lack of c):
Char * someText = new Char[20]; StrCopy(someText, "A bunch of text\0");
FieldType * aFieldPtr = ( FieldType *) GetObjectPtr<FieldType>(TextField);
// FldDelete( aFieldPtr 0, FldGetMaxChars( aFieldPtr) ); FldFreeMemory( aFieldPtr ); // FldInsert( aFieldPtr someText, StrLen(somText) );//ERROR HERE FldSetTextPtr( aFieldPtr, someText );
FldSetTextPtr() works for read-only fields only. use FldSetTextHandle() if you need to edit the field.
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
