it has been discussed here many times (with solutions and lots of
details in problems) that palm's dynamic ui functions are very
unreliable. for example removing ui elements is guaranteed to fail if
removing anything but the last element. consider creating the list as
hidden at design time, and hide/unhide it as needed

On 2/1/07, Tam Hanna <[EMAIL PROTECTED]> wrote:
Hi Folks,
I decided to get into user interface more recently, and created this
code:

        //Create second dynalist with options
        if(selection!=-1)
        {
                char** dynaptr;
                int numofitems;
                int i;
                dynaptr=MemPtrNew(9*sizeof(char*));
                for(i=0;i<9;i++)
                {
                        dynaptr[i]=MemPtrNew(20);
                }
                StrCopy(dynaptr[0],"Query");
                StrCopy(dynaptr[1],"Whois");
                StrCopy(dynaptr[2],"Time");
                StrCopy(dynaptr[3],"Ping");

StrCopy(dynaptr[4],field[selection].ignore?"Unignore":"Ignore");
                numofitems=4;
                if(isOp)
                {
                        StrCopy(dynaptr[5],"Kick");
                        StrCopy(dynaptr[6],"Ban");

StrCopy(dynaptr[7],field[selection].o?"De-Op":"Op");

StrCopy(dynaptr[8],field[selection].v?"Devoice":"Voice");
                        numofitems=9;
                }

LstNewList(&pForm,DLstUserOpts,20,20,80,120,stdFont,9,0);

LstSetListChoices(getObjectPtr(pForm,DLstUserOpts),dynaptr,numofitems);

selection=LstPopupList(getObjectPtr(pForm,DLstUserOpts));
                //Free the list

FrmRemoveObject(&pForm,FrmGetObjectIndex(pForm,DLstUserOpts));
                //Trigger the commands

The moment the list gets displayed, all I get is a Fatal Alert at the
Popup.

I suspect my command array is faulty - any ideas?

--------------------
Best regards
Tam Hanna

http://tamspalm.tamoggemon.com
Palm OS and IT management news

http://www.palmfilefind.com
FileFind for Palm OS - find files on your memory card

http://www.palmbinaryclock.com
The Binary Clock for Palm OS


--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/



--
Best Regards, Dmitry Grinberg
Software Engineer, http://PalmPowerups.com
(847) 226 9295
AIM: DmitryGrinberg
MSN: [EMAIL PROTECTED]
ICQ: 165589894
Y! IM: dmitrygr2003

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to