O'Reilly logo

REALBasic: TDG, 2nd Edition by Matt Neuburg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scrollbar

A Scrollbar is very much like a Slider. It has a Minimum, a Maximum, and a Value, which are (short) integers. Negative values are permitted. The Maximum will usually be greater than the Minimum; if not, the Scrollbar behaves as if disabled (it is dimmed and does not respond to the mouse). Any attempt to set the Value smaller than the Minimum or larger than the Maximum will fail, without error; the Value just becomes the Minimum or the Maximum, respectively.

A Scrollbar also has a LineStep, which is the amount by which the Value will change when the user clicks one of the arrows, and a PageStep, which is the amount by which the Value will change when the user clicks in the gray area; these are integers, and should be positive, or the Scrollbar will behave incorrectly.

A Scrollbar’s ValueChanged event and LiveScroll property work just like a Slider’s.

As with a Slider, you can make a Scrollbar vertical by adjusting its Height to be greater than its Width. There is also a second Scrollbar icon in the Tools Window, which is vertical to start with. Observe that the smaller dimension of a normal Scrollbar has a customary standard of 16 pixels (and the smaller dimension of a so-called “small scrollbar” has a customary standard of 11 pixels); other sizes will look odd to your users, so you shouldn’t deviate from this without good reason.

The major difference between Sliders and Scrollbars is in their usage. Although both a Slider and a Scrollbar represent a number, the Slider’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required