Graphics Reference
In-Depth Information
1.4.2
The Application
These are events defined by the application, typically depending on some run-
time conditions. During run time, if and when the condition becomes favorable,
the supporting GUI system triggers the event and conveys the favorable condi-
tions to the application. A straightforward example is a periodic alarm. Modern
GUI systems typically allow an application to define (sometimes multiple) timer
events. Once defined, the GUI system will trigger an event to wake up the appli-
cation when the timer expires. As we will see, this timer event is essential for sup-
porting real-time simulations. Since the application (our program) requested the
generation of these types of events, our program is solely responsible for serving
them. The important distinction between application-defined and user-generated
events is that application-defined events can be predictable and dependable: when
properly defined, these are events that our application can depend on. Even when
the user is not doing anything, our application can depend on application-defined
events to trigger.
1.4.3
The Window Manager and the GUI System
These are events that originated from either the window manager or within the
GUI system. These events typically convey state information to the application.
There are typically three reasons for these events.
Internal GUI states change. These are events signaling an internal state
change of the GUI system. For example, the GUI system typically gener-
ates an event before the creation of the application's main window. This
provides an opportunity for the application to perform the corresponding
initialization. In some GUI systems (e.g., MFC) the SystemInitializa
tion() functionality is accomplished with these types of events: user ap-
plications are expected to override the appropriate window's creation event
and initialize the application state. Modern, general-purpose commercial
GUI systems typically define a large number of events signaling detailed
state changes in anticipation of supporting different types of applications
and requirements. For example, for the creation of the application's main
window, the GUI system may define events for the following states:
- before resource allocation;
- after resource allocation but before initialization;
- after initialization but before initial drawing.
Search WWH ::




Custom Search