Element: graphic_window.populate { }

Type

callback

Description

One of the command procedures to be executed when "window" is repainted due to a recalculation of its contents.

When window redraw procedures are defined and invoked, the following steps are executed:

  1. The window pre_redraw procedure (if defined) is called.

  2. The window background layers ( background and/or cloth) are painted.

  3. The window redraw procedure (if defined) is called. Within this procedure, manual calls to draw graphics can be made.

  4. Other layers are painted individually. For each vector layer, a call is made to the window populate procedure (if defined) before painting, passing the group corresponding to the vector layer as a parameter.

  5. After the last vector layer has been painted, the window post_redraw procedure (if defined) is called. Within this procedure, manual calls to draw graphics can be made.

  6. Any other non-vector layers (e.g. grid, vane, scalebar) which have not already been painted are painted.

  7. Any graphic primitives on the window overlay group are painted.

The populate procedure is typically used to fetch or update entity data from an external source (typically a database) on a change of view. A graphic window has a number of groups visible in the window and a display order in which to draw them. The populate procedure is called once for every group which is both visible and present in the display order. This ensures that data can be fetched from the external source and rendered in the correct sequence.

The window identifier and the group associated with the layer being repainted are passed to the procedure as parameters.

The populate procedure is not invoked on repaints due to simple window exposure, but only on a change of window size and/or a redefinition of its corners.

Within a populate procedure there should be no commands which change the view of the window or do forced graphic draws, e.g. the draw or rasdraw commands. Requests to redraw the window contents will also be ignored. Entities should only be added to the group being populated, otherwise display-list anomalies may occur.

New windows have a populate procedure of null.

Parameters

window.populate(<window>,<group>)

See Also

Commands:

wpaint

Structures:

window.populate, window.post_redraw, window.redraw