Important: The information in this document is obsolete and should not be used for new development.
Chapter 5 -
This chapter provides a detailed look at how MacApp processes events and commands. These related topics are also described:
Events and Commands
Before reading this chapter, you may want to read Chapter 1, "MacApp Overview."
- how command objects perform operations that can be done, undone, and redone
- how behavior objects modify the behavior of other objects that handle events
- how MacApp supports efficient menu operations
- how MacApp's idle mechanism supports background tasks
Chapter Contents
- Overview
- Events and Commands
- The Command Queue
- The Main Event Loop
- Event- and Command-Handling Classes
- Behaviors
- Dispatching Events
- Direct Dispatching
- View Hierarchy Dispatching
- Mouse-Down Events
- Mouse-Up Events
- Target Chain Dispatching
- Behaviors and the Target Chain
- Menu Commands
- Key-Down Events
- Receiving Key-Up Events
- Dispatching Key-Up Events
- Alien Events
- Dispatching High-Level Events
- Target Management
- Automatic Target Changes
- Manual Target Changes
- Target Validation
- Target Change Notification
- Performing Operations With Command Objects
- Command Handlers
- The Application Object
- Command Objects
- The Command Context
- The Command Context for Classes That Handle Apple Events
- When a Command Is Complete
- Command Numbering
- Performing a Command Operation
- Command Objects and Apple Events
- Using a Command Object That Sends an Apple Event
- Using a Command Object to Respond to an Apple Event
- Linked Commands
- Undoing a Command Operation
- The Undo/Redo Menu Item
- The Undo/Redo Flow of Control
- Commands and Change Notification
- Commands and the Clipboard
- The Clipboard
- The Clipboard Manager
- Interacting With the Clipboard
- MacApp's Menu Management
- Components of MacApp Menu Management
- MacApp's Command-Numbering System
- Creating Menu Numbers on the Fly
- Optimized Menu Setup
- MacApp's Idling Mechanism
- The Cohandler Chain
- How Idling Happens
- The Three Phases of Idling
- Distributing Idle Time
- The Sequence of Idle Phases
- Idle Thoughts
- Responding to Alien Events With a Cohandler