Graphics Reference
In-Depth Information
A GUI system usually defines meaningful default behaviors for such events.
To program an effective application based on a GUI system, one must un-
derstand the different groups of events and only service the appropriate
selections.
External environment requests attention. These are events indicating
that there are changes in the windowing environment that potentially re-
quire application attention. For example, a user has moved another appli-
cation window to cover a portion of our application window, or a user has
minimized our application window. The GUI system and the windowing
environment typically have appropriate service routines for these types of
events. An application would only choose to service these events when
special actions must be performed. For example, for a real-time simulation
program, the application may choose to suspend the simulation if the appli-
cation window is minimized. In this situation, an application must service
the minimize and maximize events.
External environment requests application collaboration. These are
typically events requesting the application's collaboration to complete the
service of some general user actions (see Section 1.4.1). For example, if
a user click-drags the application window's title bar, the window manager
reacts by letting the user “drag” the entire application window. This “drag”
operation is implemented by continuously erasing and redrawing the entire
application window at the current mouse pointer position on the computer
display. The GUI system has full knowledge of the appearance of the appli-
cation window (e.g., the window frames, the menus), but it has no knowl-
edge of the application window content (e.g., how many free-falling balls
traveling at what velocity). In this case, the GUI system redraws the appli-
cation window frame and generates a Redraw/Paint event for the applica-
tion, requesting assistance in completing the service of the user's “drag” op-
eration. As an application in a shared window environment, our application
is expected to honor and service these types of events. The most common
events in this category are Redraw/Paint and Resize . Redraw/Paint is
the single most important event that an application must service because
it supports the most common operations a user may perform in a shared
window environment. Resize is also an important event to which the ap-
plication must respond because the application is in charge of GUI element
placement policy (e.g., if window size is increased, how the GUI elements
should be placed in the larger window).
Search WWH ::




Custom Search