Hi
maybe you forgot to set the table visible.
It's an item located in the TableAttrType structure of the TableType structure
that's called tableP in your program.
To see what's in there you better look up
at:
http://www.palmos.com/dev/support/docs/palmos/Table.html#995852
Hope this helps
greetings
Christian
"Palm Developer Forum" <[EMAIL PROTECTED]> schrieb am 21.07.04 23:24:32:
>
> Hey,
>
> Whats wrong with this code. Im trying to display bitmap in table cell. the
> table is supposed to have 8 rows and 2 columns. But it complies and doesnt
> show any table. Im pretty sure im doing somehting wrong with
> TblSetItemStyle(tableP, i, 1, customTableItem) but i dont know what. Im new
> at palm prog. by the way. Thanks
>
>
> static Boolean TableFormHandleEvent(EventPtr event)
> {
>
> Boolean handled = false;
> FormPtr frm;
>
>
> switch (event->eType)
> {
> case frmOpenEvent:
> {
> frm = FrmGetActiveForm();
> FrmDrawForm(frm);
> UpdateTable();
> WinDrawGrayLine(2,145,158,145);
> handled = true;
> break;
> }
> default:
> break;
> }
> }
> void drawCallback (void *tableP, Int16 row, Int16 column, RectangleType
> *bounds)
> {
> Int16 nValue = TblGetItemInt(tableP,row,column);
> MemHandle bitmapH;
> BitmapPtr bitmapP;
>
>
> bitmapH = DmGetResource('Tbmp', testBit);
>
> if ( !bitmapH )
> return;
>
> bitmapP = (BitmapPtr) MemHandleLock (bitmapH);
> WinDrawBitmap (bitmapP, bounds->topLeft.x, bounds->topLeft.y);
> MemHandleUnlock (bitmapH);
> }
>
> void UpdateTable()
> {
> FormPtr frmP = FrmGetActiveForm();
> TablePtr tableP = FrmGetObjectPtr( frmP,
> FrmGetObjectIndex(frmP,Table));
> UInt nNumRows = TblGetNumberOfRows(tableP);
> UInt i = 0;
>
> for (i = 0; i < nNumRows; i++)
> {
> TblSetItemStyle(tableP, i, 0, numericTableItem);
> TblSetItemInt(tableP, i, 0, i);
>
>
> TblSetItemStyle(tableP, i, 1, customTableItem);
>
> }
>
>
>
> for (i = 0; i < 2; i++)
> {
> TblSetColumnUsable(tableP,i,true);
> }
>
> TblSetCustomDrawProcedure(tableP,1,drawCallback);
> TblDrawTable(tableP);
>
>
> }
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
> http://www.palmos.com/dev/support/forums/
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/