Hi Chuck.

While it does not explicitly tell you about the return value from a menu handler, the User Guide (p 292 and p 449-450) tells about how to enable menu items, and how they are called.

They describe a hierarchy, where the handler(s) can be called
1) for a menu item
2) for the active window, then
3) for the app

The return value for such handlers tells the RB routines whether the task has been accomplished or not. Returning false says "I didn't do it - look farther". Returning true says "I did it - don't bother anyone else".

The default return is false. If you have only one handler in the chain, (the usual case) it won't matter, except it adds a tiny bit of overhead.

To be consistent with the rest of the system, you should return true on success.

Russ


On May 21, 2006, at 6:13 AM, Charles Ross wrote:

I just noticed for the first time that menu handlers are functions that return a boolean value. I've looked through the language guide and the user's manual, but can't find what this is for. I've not been returning anything from menu handlers, and it's worked, so I'm assuming that whatever the default is is fine, but, well it now feels wrong to not return the appropriate boolean. :)

Thanks,
Chuck Ross

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to