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 (color and/or image and/or cloth) is painted.

  3. The window redraw procedure (if defined) is called.

  4. If the window has a populate procedure defined, it is called for every group viewable in the window. If the window does not have a populate procedure defined, the window foreground (entity graphics) is painted.

  5. The window foreground (entity graphics) is painted.

  6. The window post_redraw procedure (if defined) is called.

  7. The window auto-grid and/or auto-vane are painted.

This 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 being processed 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