This section describes how your application actually does anything when the user chooses a menu item. Apart from some of the default menu items described earlier (in Section 6.3), choosing a menu item has no effect whatever unless your code responds. Here’s how to make it respond.
When a menu item is chosen, by way of the mouse or a Command key equivalent, REALbasic sends a menu event. It is up to your code to handle this menu event, in a menu event handler . In a MenuItem subclass, the menu event handler is provided for you, but otherwise creating a menu event handler is up to you. You must decide where to put it, and to do so, you need to understand where menu events are sent. The sequence resembles, but is not identical to, the sequence of events during a menu-enabling moment:
If an instance of an EditField or ListBox subclass has the focus, the instance receives a menu event.
The frontmost visible nonfloating window receives the same menu event.
The Application subclass receives the same menu event. This does not happen, though, if the frontmost visible window is modal.
If the chosen menu item is an instance of a MenuItem subclass, then it receives the same menu event. This does not happen, though, if the frontmost visible window is modal.
On Windows, a modal window behaves like a floating window for purposes of these rules; in other words, a modal window itself does not block or receive any menu events.
During the first three stages, the ...