RapaGUI will pass the identifier of a Hollywood brush whose size is
exactly as big as the visible area of your scrollcanvas widget to your
callback. You then have to draw the desired contents to this brush.
Precisely, you just have to draw to the rectangle defined by the
four coordinates X
, Y
, Width
, and Height
which are passed to your
callback as well. These four coordinates describe a rectangular area
within the dimensions of the brush that is passed to your callback.
When a full redraw is needed, X
and Y
will be 0 and Width
and Height
will match the dimensions of the brush. Most oftenly, however, only
a partial redraw is needed and then you must only draw to the portion
of the brush defined by those coordinates.
The following extra arguments will be passed to your event handler:
Brush:
SelectBrush()
command to select this brush as the output device in
your callback. Don't forget to call EndSelect()
when you are done!
ViewWidth:
ViewHeight:
ScrollX:
ScrollY:
VirtWidth:
VirtHeight:
X:
Y:
Width:
X
).
See above for details.
Height:
Y
).
See above for details.
To compute the absolute position of the content that should be drawn
to the canvas, just add the ScrollX+X
and ScrollY+Y
coordinates and you're done.
See Notifications for details.