Mitch,
Try:
Change first arg to Int16 instead of UInt
Reference (from CW install):
..\CW for Palm OS R6\Palm OS 3.5 Support\Incs\Core\UI\List.h
// Load data callback routine prototype
typedef void ListDrawDataFuncType (Int16 itemNum, RectangleType *bounds,
Char **itemsText);
Regards,
Randy Maxwell
[EMAIL PROTECTED]
-----Original Message-----
From: Mitch Fawcett [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 08, 2000 7:30 PM
To: Palm Developer Forum
Subject: List drawing callback error
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/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/