Hi all,

I'm relatively new to Palm development and am having a little difficulty
with popuplists.

In GCC/PilRC I'm trying to create a static (at this time, but eventually
I hope to make it dynamic from a database, but first things first).  I
get the trigger fine and I set the selected item fine, but when I click
on the trigger the selection list does not "pop up". Based on what I've
seen in FAQ's and in a few of the messages here, I've set it up
properly.  Since it's not working, there must be some little (or not so
little) thing that I'm doing wrong or missing, any help is appreciated.

My resource is defined in a form like so:

   FORM ID MainForm AT (0 0 160 160)
   NOFRAME
   MODAL
   USABLE
   HELPID Help
   MENUID MenuBar
   BEGIN
     TITLE "List Test"
     POPUPTRIGGER "" ID MyPop AT (55 30 43 12) LEFTANCHOR USABLE NOFRAME
FONT 0
     POPUPLIST ID MyPop MyList
     LIST "List Item 1" "List Item 2" "List Item 3" "List Item 4" "List
Item 5" "List Item 6" ID MyList AT (55 30 60 33) NONUSABLE DISABLED
VISIBLEITEMS 3 FONT 0
   END


I am setting the trigger selection/display when initializing my form in
the following:


    ListPtr listP;
    ControlPtr ctrlP;
    Int16 listSelection;
    FormPtr frmP;

    frmP = FrmGetActiveForm();
    listP = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, MyList));
    ctrlP = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, MyPop));

    listSelection = 3;
    LstSetSelection(listP, listSelection);
    CtlSetLabel(ctrlP, LstGetSelectionText(listP, listSelection));

    FrmDrawForm(frmP);


I also have a handler (within the event handler for the form that the
popup is within) for when a selection is made (though it does nothing at
the moment):


   case popSelectEvent:
      if (eventP->data.popSelect.controlID == MyPop)
         listSelection = eventP->data.popSelect.selection;
      handled = true;
      break;


Thanks for any help you can provide.

Also, if anyone can provide a reference to help me optimize memory use,
performance, size, etc. it would be greatly appreciated.

Cheers,

Andrew


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

Reply via email to