I have created a dynamic popup list from the database using a callback function in LstSetDrawFunction. The trigger is attached to the list in the constructor. When the form opens, the trigger label is set to the first item. Upto this point it is working fine.
Problem:-If the popup trigger is selected, the list is not being displayed. I have made handled = true in popSelectEvent as the trigger label is set from the data got from the database since LstGetSelectionText cannot be used. However, If I make handled = false(Which I think is wrong), the list is displayed properly but "read memory from memory location ....,which is in low memory" error is got when an item is selected from the list.
How to display the list when the trigger is activated in the above case????
Code snippet:-
static void MainListDraw(Int16 itemNum, RectangleType *bounds, Char** itemsText)
{
......
WinDrawChars(s,StrLen(s),bounds->topLeft.x,bounds->topLeft.y);//s got from database
}
static void MainFormInit(FormPtr /*frmP*/)
{
........
List = (ListType *)GetObjectPtr(PigmyAccountNoListList);
LstSetListChoices(List, NULL, n);//n=no. of records in the database
LstSetDrawFunction(List, MainListDraw);
LstSetHeight(List, 5);
.........
ctl = (ControlPtr)GetObjectPtr (PigmyAccountNoTriggerPopTrigger);
CtlSetLabel (ctl,str);//str got from database
}
static Boolean MainFormHandleEvent(EventPtr eventP)
{
switch (eventP->eType)
{
case popSelectEvent:
switch (eventP->data.popSelect.controlID)
{
case TriggerPopTrigger:
..............
ctl = (ControlPtr)GetObjectPtr (TriggerPopTrigger);
CtlSetLabel (ctl,s);
//handled = false;//Low memory error is got
handled = true;//List is not displayed
break;
default:
break;
}
default:
break;
}
return handled;
}
Hope someone will help me. Thanks in advance,
Vidya
_________________________________________________________________
Dress up your desktop! Get the best wallpapers. http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp Just click here!
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
