[previous] [up] [next]     [index]
Next: on-save-file Up: editor<> Previous: on-new-image-snip

on-paint

Provides a way to add arbitrary graphics to an editors's display. This method is called just before and just after every painting of the editor.

The on-paint method, together with the snips' draw methods, must be able to draw the entire state of an editor. Never paint directly into an editor's display canvas except from within on-paint or draw. Instead, put all extra drawing code within on-paint and call invalidate-bitmap-cache when part of the display needs to be repainted.

The on-paint method must not make any assumptions about the state of the drawing context (e.g., the current pen), except that the clipping region is already set to something appropriate. Before on-paint returns, it must restore any drawing context settings that it changes.

The editor is internally locked for writing and reflowing during a call to this method (see also Locks).



PLT