An entry point for scrollbars

Maloney johnm at wdi.disney.com
Wed Feb 25 00:51:21 UTC 1998


At 3:13 PM -0500 2/24/98, Ian Bicking wrote:
>The talk about scrollbars made me realize that I never really use the
>Squeak scrollbars effectively, instead just dragging up and down
>lists.  I've found the scrollbars in the Oberon system work very well
>for me, and I think they'd fit well into Squeak.
>
>Unfortunately, I find it very difficult to figure out where I should
>go to change behaviour in MVC.  If someone can tell me what
>class/method(s) provide a good place for modification of scrollbar
>behavior, that would be great.


I'd consider trying to implement your new scrollbars in Morphic.
There are some examples there already (e.g., SliderMorph) and
Morphic is the wave of Squeak's future. Plus, I think you'll find
it easier than working with MVC.

I usually start with an empty subclass of some generic morph
like RectangleMorph, then add
some instance variables and an initialization method (e.g. a
"currentPosition" variable to store the slider's position),
then a "drawOn:" method. At that point, I make an instance
in a MorphWorld to see what it looks like, and possibly
modify the drawOn: method. I then add mouse behavior by
overriding the mouse handling protocol. Be sure to
to override "handlesMouseDown:" to return true.
Then add behavior for mouse down, move, and up.

It typically takes me under an hour to get a new interactive
widget going, and most of that time is spent tweaking
the appearance, which is rather enjoyable. It may take
you longer the first time you do it, but by following
the example of existing Morphs I suspect you'll have
something going in under a day.

Note that we hope to have Morphic versions of all the
MVC browser and other tools in the next release.

Good luck!

	-- John





More information about the Squeak-dev mailing list