Rodolphe, Yes, I tried the following to set the no. of items in the list. Still the callback function is not being called when the form opens. LstSetListChoices(List, NULL, n);//n is set from the no. of records in the database LstSetDrawFunction(List, MainListDraw); The callback function however gets called when the popup trigger is selected after the form opens. Can you please help me to get the callback function working on the form open? Vidya.
> > static void MainListDraw (Int16 itemNum, RectangleType *bounds, Char**did you set the number of items of the list before, so the callback is called as many time as the number of item specified ?
----- Original Message -----
> Hi All,
> I have a popup trigger attached to a list which is created from
a
> database by a callback function
> (LstSetDrawFunction) in the MainFormInit routine.
>
> I have pre-set the label for the popup trigger
> to be the 1st choice in the list when the form opens.
> Problem:- The callback function is not being called when the form opens.
> Here is the code snippet:-
> itemsText) > { > MemHandle recordH = NULL; > BanksoftDBRecordType *record = NULL; > recordH = DmQueryRecord (gPigmyDB, itemNum); > if (! recordH==NULL) > { > record = MemHandleLock (recordH); > UnpackBanksoftRecord (&BanksoftDBRecord, > (const PackedBanksoftRecord *) record); > if(itemNum==0) > { > ListData = BanksoftDBRecord.Rowfields [1]; > } > WinDrawChars (BanksoftDBRecord.Rowfields [1], StrLen > (BanksoftDBRecord.Rowfields [1]), bounds->topLeft.x, > bounds->topLeft.y); MemHandleUnlock (recordH); > } > } > > static void MainFormInit (FormPtr /*frmP*/) > { > ControlPtr ctl; > Char * str; > ListType *List; > UInt16 n=0, ListSelect; > n=DmNumRecords (gPigmyDB); > List = (ListType *) GetObjectPtr (PigmyAccountNoListList); > LstSetDrawFunction (List, MainListDraw); > LstSetListChoices (List, NULL, n); > LstSetHeight (List, 5); > ctl = (ControlPtr)GetObjectPtr (PigmyAccountNoTriggerPopTrigger); > CtlSetLabel (ctl, ListData); > }
_________________________________________________________________
Looking for love? Yearning for friendship? http://www.msn.co.in/Romance/ You're in the right place
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/