On Thu, Feb 24, 2000 at 07:32:21PM -0500, Dan Hewins wrote:
> I do have a callback...
>
> rows = TblGetNumberOfRows(table);
> // set all of the table items to be custom
> for (i = 0; i < rows; i++) {
> for ( j = 0; j < HGPAGE_MAX_COLS; j++ ) {
> TblSetItemStyle(table, i, j, customTableItem);
> }
> ...
> }
>
> // set the columns usable or not usable, width, spacing, and the draw procedure
> for ( i = 0; i < HGPAGE_MAX_COLS; i++ ) {
> ...
> TblSetCustomDrawProcedure(table, i, HGPage::DrawItemCallback);
> }
>
>
> I step through the code in the debugger and the call to
> TblSetItemStyle **Does absolutely nothing**!
I don't know why this doesn't work, but perhaps you need to set the
column as usable and define the custom draw procedure first, before
setting the item style? This is what I do:
width = TblGetColumnWidth(table,0) ;
height = width + 1 ;
for ( column=0 ; column<nColumns ; column++ )
{
TblSetCustomDrawProcedure(table,column,DrawChartCell) ;
TblSetColumnUsable(table,column,true) ;
for ( row=0 ; row<nRows ; row++ )
{
TblSetItemStyle(table,row,column,customTableItem) ;
TblSetItemInt(table,row,column,(row+offset)*nColumns+column) ;
TblSetRowHeight(table,row,height) ;
}
}
TblMarkTableInvalid(table) ;
and all I can say is, it works for me. :/ This is CW R5, btw.
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html