Firm foundation in the main hci principles, the book provides a working


Download 4.23 Mb.
Pdf ko'rish
bet56/97
Sana23.09.2023
Hajmi4.23 Mb.
#1685852
1   ...   52   53   54   55   56   57   58   59   ...   97
Bog'liq
Human Computer Interaction Fundamentals

System
Event Queue
Window
Manager
Event 100
Type: Mouse click
(Root Window)
Application 1
(Window 1)
Event 76
Event 75
Event 74
Application 2
(Window 2)
Application
Event Queue
Dispatched
according to
current “focus”
Value: Left button
Time: 05:12:54
Window 1




Event 99
Type: Mouse click
Value: Right button
Time: 05:12:57
Root Window




Event 98
Type: Mouse move
Value: 100 100
Time: 05:12:56
Window 2




Figure 5.5 Event queuing at the top application level.


9 0
H U M A N – C O M P U T E R I N T E R A C T I O N 
generate pseudo-events for creating chain effects. For example, when 
a scroll bar is moved, both the window content and the scroll bar posi-
tion have to be updated [1].
5.3.2 Event-Driven Program Structure
Based on what we have discussed so far, the event-driven program 
structure generally takes the form of the structure depicted in 
Figure 5.7. The first initialization part of the program creates the nec-
essary UI objects for the application and declares the event-handler 
functions and procedures for the created UI objects. Then the pro-
gram enters a loop that automatically keeps removing an event from 
the application event queue and invoking the corresponding handler 
(i.e., dispatching the event). The development environment often 
hides this part of the program so that the developer does not have to 
worry about such system-level implementations. However, depend-
Area to be
renewed and redrawn
System

Download 4.23 Mb.

Do'stlaringiz bilan baham:
1   ...   52   53   54   55   56   57   58   59   ...   97




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling