In the course of searching for ways to simplify user tasks, G5G has developed a number of solutions for using GPHIGS in conjunction with the Motif toolkit. We may begin to look at the problems associated with the combination of a user interface toolkit with a library of standard graphic functions by looking at typical applications. In general, a typical PHIGS application program may be represented as follows:
1. Initialization of user variables
2. Initialization of PHIGS
3. Construction of the CSS
4. Animation
Editing the CSS
Redisplay
5. Termination
An application written with the use of a toolkit (Motif e.g.) may be similarly broken down:
1. Initialization of the toolkit
2. Creation of widgets
3. Event management
Handler
4. Widget activation
5. Event loop (main loop)
Comparing the two forms of program, with the intention of merging the two, a number of problems surface:
1. How to integrate the construction of the CSS in the program and display when the graphic window is opened without waiting for user interaction (pushbutton, e.g.).
2. How to associate the graphic window with a widget.
3. How to manage graphic events (locator or pick events e.g.).
4. How to perform animation that will not interfere with the operation of the event loop (main loop).
We will examine each of these points and study the solutions.