Next: Example for Discussion
Up: Basic User Interface
Previous: Event Queues
Event-loop processing can be generalized:
- Instead of switch, use table lookup.
- Each table entry associates an event with a callback function.
- When event occurs, corresponding callback is invoked.
- Provide an API to make and delete table entries.
- Divide screen into parcels, and assign different callbacks
to different parcels (X Windows does this).
- Event manager does most or all of the administration.
Modular UI functionality is provided through a set of widgets:
- Widgets are parcels of the screen that can respond to events.
- A widget has a graphical representation that suggests its function.
- Widgets may respond to events with a change in appearance,
as well as issuing callbacks.
- Widgets are arranged in a parent/child hierarchy.
- Event-process definition for parent may apply to child,
and child may add additional event-process definitions
- Event-process definition for parent may be redefined within child
- Widgets may have multiple parts, and in fact may be
composed of other widgets in a heirarchy.
Some UI toolkits: Xm, Xt, SUIT, FORMS, Tk ...
CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab
cs488@cgl.uwaterloo.ca