Programming guideline of WinDom
A redraw function (as every event function) has the following
structure:
void a_redraw_function ( WINDOW *win) {
...;
}
The parameter win is the descriptor of the window that has to be
redrawed. Let's give some important remarks to design this redraw
function.
- Fist of all, one should not clip anything (i.e. use the VDI
clipping functions) inside the redraw function. The clippping
zone is handled by EvntWindom() (by using the AES rectangle
list).
- When you perform VDI calls, you can use the VDI virtual
workstation opened by WindCreate(). The handle of this
workstation is given by the variable win->graf.handle.
- The content of a window often depends on the sliders
positions and the size of the window. For that purpose, several
field of the window descriptor are devoted to help you managing
sliders. These are win->xpos, win->ypos, win->xpos_max
and win->ypos_max. For more details, read the section about
the (!url [sliders] [Window sliders]).
- By convention, the first thing to do in the redraw function
is to call the function WindClear() to draw the background. This
function can be parametrized by the user.
In the next section, we'll see some examples that create windows.
You'll see also how to attach data to a window using the Windom
DataAttach() funciton.