Hey... maybe before everyone heads off to PalmSource someone could help me
out. Here is a compile error I have been staring at for the past three
hours.
Error : cannot convert
'void (*)(unsigned short, struct RectangleType *, char **)' to
'void (*)(short, struct RectangleType *, char **)'
SuperList3.c line 9078 LstSetDrawFunction( plst, ListDrawFunc );
Here are my functions:
// My drawing callback function
static void ListDrawFunc (UInt itemNum, RectanglePtr bounds, CharPtr *data)
{
CharPtr cpText = NULL;
cpText = gArrayOfLists[itemNum]; // an item out of a global array of
strings.
if (cpText)
{
// Draw it
WinDrawChars (cpText, StrLen (cpText), bounds->topLeft.x,
bounds->topLeft.y);
}
}
In the event handler for my form
...
case frmOpenEvent:
{
// I initialize the array of strings, gArrayOfLists[iNumLists],
and get a list pointer, plst.
// Set the drawback for the list.
LstSetDrawFunction( plst, ListDrawFunc ); <- this line is what generates
the error.
// Set the list.
LstSetListChoices (plst, NULL, iNumLists);
}
Note the error message refers to "RectangleType" but the callback function
and its header declare a "RectanglePtr".
Mitch Fawcett
Tapn'see Software
Home of SuperList2 (and hopefully SuperList3)
http://www.tapnsee.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/