Difference between revisions of "Event Loop"
Jump to navigation
Jump to search
(add category) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
== Main Event Loop == | == Main Event Loop == | ||
− | The principal control loop for [[Application|applications]] that are driven by events. | + | The principal control loop for [[Application|applications]] that are driven by [[Event|events]]. |
From the time it's launched until the moment it's terminated, an [[application]] gets one keyboard or mouse event after another from the Window Server and responds to them, waiting between events if the next event isn't ready. | From the time it's launched until the moment it's terminated, an [[application]] gets one keyboard or mouse event after another from the Window Server and responds to them, waiting between events if the next event isn't ready. | ||
Line 12: | Line 12: | ||
Typically, a mouse-down event initiates the modal loop and the following mouse-up event ends it. The loop gets mouse-dragged events (or mouse-entered and mouse-exited events) to track the cursor's movement while the user holds the mouse button down. | Typically, a mouse-down event initiates the modal loop and the following mouse-up event ends it. The loop gets mouse-dragged events (or mouse-entered and mouse-exited events) to track the cursor's movement while the user holds the mouse button down. | ||
+ | |||
+ | [[Category:Objective-C]] |
Latest revision as of 14:50, 23 October 2006
Main Event Loop
The principal control loop for applications that are driven by events.
From the time it's launched until the moment it's terminated, an application gets one keyboard or mouse event after another from the Window Server and responds to them, waiting between events if the next event isn't ready.
In the Application Kit, the NSApplication object runs the main event loop.
Modal Event Loop
A temporary event loop that's set up to get events directly from the event queue, bypassing the main event loop.
Typically, a mouse-down event initiates the modal loop and the following mouse-up event ends it. The loop gets mouse-dragged events (or mouse-entered and mouse-exited events) to track the cursor's movement while the user holds the mouse button down.