[previous] [up] [next]     [contents] [index]
Next: on-save-file Up: wx:media-buffer Previous: on-new-image-snip

on-paint

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

The on-paint method, together with the snips' draw methods, must be able to draw the entire state of a buffer. Never paint directly into a buffer'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 approrpiate. Before on-paint returns, it must restore any drawing context settings that it changes.



PLT