--- Phil <[EMAIL PROTECTED]> wrote:
> 
> Yes modifying say a static declared in the form event
> handler, that called the menu event handler would be
> ideal.
> 
> But if one can't pass the menu handler any data I have
> no way to pass it a pointer to the static or some
> such.  
> 

I am confused by what you seem to think the menu handler function is. 
The form handler you specify with FrmSetEventHandler() gets called by
the OS with a menuEvent when a menu item is selected.  Normally, you
pass the id of the selected menu item to a function that you create
(e.g., MainFormDoCommand()).  That function, which is what I am calling
the menu handler, can take any parameter list you want it to take.  The
only requirement is that your form event handler has to return true if
it (or something it called) handled the event.

Here's an example (untested code):

static Boolean MainFormHandleEvent(EventPtr eventP)
{
  UInt16 data;

  // ...
  case menuEvent:
    return MainFormDoCommand(eventP->data.menu.itemID, &data);

  // ...
}

- and -

static Boolean MainFormDoCommand(UInt16 command, UInt16 *data)
{
  // ...
  case MainOptionsWhatever:
    // after whavever else you want to do...
    *data = 25;  // pass back 25, for example
    handled = true;
    break;
  // ...
  return handled;
}


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com


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

Reply via email to