You can't initialize a textTableItem with a char *, you need a Handle
instead. What you have would work if you had used labelTableItem.

-- John Schettino, author of that other Palm programming book
http://schettino.tripod.com

-----Original Message-----
From: Nicholas Breau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 12, 2000 12:28 PM
To: Palm Developer Forum
Subject: Can anybody spot the problem ?


I'm trying to build my first Table object.  The following code is what seems
to be needed from the O Reilly book, however, I get a "Invalid Parameter"
error ... can anybody help, I'm stumped, the code is fairly simple.

TablePtr   tableP;
 UInt    numRows;
 UInt    i;
 static char * labels[] = {"0000", "0001", "0002", "0003", "0004", "0005",
"0006", "0007"};

 tableP = (TablePtr)FrmGetObjectPtr(frm, FrmGetObjectIndex(frm,
PlotsTreeTable));
 numRows = TblGetNumberOfRows (tableP);

 for (i = 0; i < 2; i++)
  TblSetColumnUsable(tableP, i, true);
 for (i = 0; i < numRows; i++)
  TblSetRowUsable(tableP, i, true);

 for (i = 0; i < numRows; i++) {
  TblSetItemStyle(tableP, i, 0, textTableItem);
  TblSetItemPtr(tableP, i, 0, labels[i]);
  TblSetItemStyle(tableP, i, 1, textTableItem);
  TblSetItemPtr(tableP, i, 1, labels[i]);

 }

 FrmDrawForm(frm);

thanks for any help,
Nick.




-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to