Well,
I solved this *impossible* problem that had been plaguing me for
weeks now. I tried adding the other TblSetItem... functions to my
loop below like TblSetItemInt, TblSetItemPtr, and TblSetItemFont. I
saw that the table->items[] pointer was off and I investigated
further to find that the tableItemStyles element of the TableItemType
structure is an enum. Well I had "enums always int" checked in my
project settings and when I unchecked it, the problem was solved.
typedef struct {
TableItemStyleType itemType;
FontID fontID; //
font for drawing text
Int16 intValue;
Char * ptr;
} TableItemType;
enum tableItemStyles { checkboxTableItem,
customTableItem,
...
};
typedef enum tableItemStyles TableItemStyleType;
This leads me to believe that there is some code in the Table.c file
that is buggy in that it assumes that the size of the tableItemStyles
enum is a byte always instead of an int if the project setting is set.
Can you force an enum to be a certain size in the definition? e.g.:
enum Uint8 tableItemStyles { checkboxTableItem,
customTableItem,
...
};
Thoughts?
Dan Hewins
Synergy Solutions, Inc.
At 5:28 PM -0500 2/24/00, Dan Hewins wrote:
>Hi all,
>
>I am having a recurrence of a VERY strange problem that I was
>experiencing with CodeWarrior r5 and now I am having with r6.
>
>I am trying to make a table full of customTableItems and they are
>all turning out to be checkboxTableItems.
>
>Here's some code I use:
>
>for (i = 0; i < rows; i++) {
> for ( j = 0; j < HGPAGE_MAX_COLS; j++ ) {
> TblSetItemStyle(table, i, j, customTableItem);
> }
> ...
>}
>
>The call to TblSetItemStyle **Does absolutely nothing** when I step
>through in the debugger. All of the items are initially
>checkboxTableItems and after the call to TblSetItemStyle, they still
>are checkboxTableItems.
>
>I am using CodeWarrior for Palm OS R6 and the 3.5 SDK:
>
>Palm OS 3.5 Headers
>PalmRez Post Linker (v4.1b8 created Jan 12, 2000 2:40 PM)
>PalmPlugin (v1.6.2d1 created Jan 12, 2000 2:40 PM)
>
>Any ideas?
>
>Has anyone else had this problem?
>
>Thanks,
>Dan Hewins
>Synergy Solutions, Inc.
>
>--
>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