class MessageHandler

MessageHandler is an abstract base class for objects which participate in the message delivery hierarchy. The message delivery mechanism is used to handle events such as keystrokes and menu commands which are not directed at a particular point on the screen. See Event Handling for more information.

Methods

handle(msg_name, ...)
If there is a method with the same name as the message, calls it with the message arguments. Otherwise, passes the message to the next handler.

handle_here(msg_name, ...)
If there is a method with the same name as the message, calls it with the message arguments. Otherwise, does nothing.

handle_event(event)
Equivalent to handle(event.kind, event).

handle_event_here(event)
Equivalent to handle_here(event.kind, event).

pass_to_next_handler(msg_name, ...)
Calls the handle() method of the next message handler, if any.

pass_event_to_next_handler(event)
Equivalent to pass_to_next_handler(event.kind, event).
next_handler()
Returns the object, if any, to which messages not handled by this object should be passed up.

Abstract Methods

key_down(event)
key_up(event)
These methods are called in response to keyboard events. The default implementations pass the event to the next handler.

setup_menus(menu_state)
During the menu setup phase of menu command processing, this method is called for all handlers along the message path in reverse order, i.e. from the Application down to the current target. MessageHandlers should use this method to enable and otherwise configure any menu items that they respond to and which are currently valid. See Menu Setup for more information.