Displaying on either Form or DisplayScreen

Paul Chapman paul at igblan.com
Mon May 12 23:31:05 UTC 2003


I'm using the following code fragment to display some text:

MyPane>>drawOn: aCanvas
    ...
    text
        displayOn: aCanvas form
        at: point
        clippingBox: bounds
        rule: Form paint
        fillColor: nil.

When 'aCanvas form' is a DisplayScreen, everything is fine, because 'point' is relative to the screen.

However, when the window containing the pane is dragged, the text is offset in the pane by the (initial) window origin minus the screen origin, presumably because 'aCanvas form' is a temporary bitmap containing the contents of the window to be dragged, and offsets in it are measured from the window origin, not the screen origin.

Is there a simple/recognized way of working around this?

TIA.

Cheers, Paul



More information about the Squeak-dev mailing list