I have a table with two columns. The second column is supposed to contain a
plug-in name. I need to save a few things about the plug-ins installed, so I fill a
structure and create a linked list. Structure looks like so:
struct ae2ShellTableItemStruct
{
char strName[dmDBNameLength];
ULong creator;
ULong type;
BitmapPtr iconPtr;
struct ae2ShellTableItemStruct *Next;
struct ae2ShellTableItemStruct *Prev;
};
typedef struct ae2ShellTableItemStruct ae2ShellTableItemType;
Notice, I am using pointers.
The structure gets filled correctly and contains good string pointers and the
list gets built. I then fill the table using the linked list like so:
void FillPlugInTable(void)
{
FormPtr frmP;
TablePtr tableP;
int xx=0;
ae2ShellTableItemType *CurItem=TableItemsHead;
frmP = FrmGetActiveForm(); // get a pointer to the main form
if (frmP)
{
tableP = FrmGetObjectPtr(frmP,
FrmGetObjectIndex(frmP,
MainPluginTableTable));
if (tableP)
{ // we have a table and a form....
TblEraseTable(tableP);
while(CurItem != NULL && xx < 4)
{
TblSetItemStyle(tableP, xx, 0, numericTableItem);
TblSetItemInt(tableP, xx, 0, 123+xx);
TblSetItemStyle(tableP, xx, 1, labelTableItem);
TblSetItemPtr(tableP, xx, 1, CurItem->strName);
++xx;
CurItem = CurItem->Next;
}
TblDrawTable(tableP);
}
TblSetColumnUsable(tableP, 0, true);
TblSetColumnUsable(tableP, 1, true);
FrmDrawForm(frmP);
}
}
The int variable xx is just used to keep everything small right now.
Everything seems fine until FrmDrawForm() gets called. The first two rows are
drawn and the I get an error code 44. Any ideas? Should I not be using pointers? Do
I need a custom draw function? (I have tried cell types of labelTableItem and
textTableItem, both giving the same results.)
I know I must be doing something very simply wrong.
Any help would be highly appreciated,
bryon lape
-------------------------------------------------------------
Did you get your bonus check?, visit http://www.grey-net.com/