Event Loop

From GNUstepWiki

(Difference between revisions)
Revision as of 13:21, 9 November 2005
Cbv (Talk | contribs)
Main Event Loop
← Previous diff
Revision as of 10:16, 21 April 2006
Cbv (Talk | contribs)
Added link to Event
Next diff →
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.

Revision as of 10:16, 21 April 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.