Hi All,
I am trying to implement a custom draw method for a listbox and I having
some trouble.
My code is basically as follows:
form = FrmInitForm( ListForm );
if( form )
{
list = GetObjectPtr( AList );
if( list )
{
LstSetDrawFunction( list, (ListDrawDataFuncPtr)DrawMe );
number = sizeof(ListElements)/sizeof(ListElements[0]);
/* CRASH */
LstSetChoices( list, NULL, number );
button = FrmDoDialog( form );
/*
Handle button and get data from form.
*/
FrmDeleteForm( form );
}
}
My callback is:
static void DrawMe(Int16 i, RectangleType * b, Char ** text)
{
WinDrawChars( ListElements[i],
StrLen( ListElements[i],
bounds->topLeft.x,
bounds->topRight.y );
}
No it seems to be crashing at LstSetChoices... I am sure it is something
obvious but I am still a learner ;-)
Thanks in advance.
Andy
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/