Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 803
News FAQ
Search Home


next up previous contents
Next: Motion and Position Events Up: Events Previous: Events

Refresh Events

The refresh event mechanism is used to synchronise the display of data to the user. For example, when a parameter is changed in a DisplayData, a refresh event should be generated such that all WorldCanvases displaying that DisplayData are redrawn if necessary. Or, if a PixelCanvasColorTable is physically resized, all PixelCanvases using that ColorTable must be cleared and redrawn.

Any class in the Display Library can register its interest in refresh events in one of the following ways:

Having taken one of the options above, the class need simply then register itself, or its helper class, as an event handler with all potential sources of the event of interest. A specific example is the WorldCanvas class, which wishes to know when its underlying PixelCanvas is resized, so that it can resize itself accordingly. To this end, the WorldCanvas class creates a helper class, called ``WCOnPCRefreshEH'', an instance of which can be registered as a handler of PixelCanvas refresh events, and whose only function is to add World Coordinate information to the event and pass it on to its parent WorldCanvas. The function called on the WorldCanvas can then look at the type of the refresh, and if it is a size change, will then act accordingly.

There are many possible reasons for a refresh event to be generated, and indeed such an event can be generated by any class which allows other objects to register themselves as handlers of refresh events. The types of refresh event are listed in DisplayEnums.h, and include:


next up previous contents
Next: Motion and Position Events Up: Events Previous: Events   Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2004-08-28