Difference between revisions of "Event Loop"

From GNUstepWiki
Jump to navigation Jump to search
 
Line 3: Line 3:
 
The principal control loop for [[Application|applications]] that are driven by events.
 
The principal control loop for [[Application|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 [[AppKit|Application Kit]], the [[NSApplication]] [[object]] runs the main event loop.
+
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 [[AppKit|Application Kit]], the [[NSApplication]] [[object]] runs the main event loop.
  
 
== Modal Event Loop ==
 
== Modal Event Loop ==

Revision as of 13:21, 9 November 2005

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.