[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hello, world!
A don't think a scrollMorph should be very difficult to implement. The idea is
to use the ability to set the clipping rectangle of a canvas, along with the
ability of a canvas to translate all drawing operations by some offset. The
scrolling morph would override the drawOn: method and would make a copy of the
canvas with the desired offset and clipping box. It would then do
"resend.drawOn:" passing this canvas as the argument. This one method should be
all you need to get the output side working. On the input side (if you want
things within the scrollMorph to be mouse-sensitive) you have to override the
event dispatching method (whose name escapes me at the moment) to translate the
coordinates in the incoming events in the appropriate way. Again, I think you
only need to fix one method.
By the way, I'm not saying it is obvious how to build a scrollMorph. I always
meant to build one as an example, but there was always something a little bit
higher on the priority list...
Let us know if you build a scollMorph (and maybe even send us your code!).