How would I go about create a thin scroll bar like in the Stickies app on OSX Lion?
-
2That's the default scroller on Lion, it comes with all Scroll Views. Are you saying you want to recreate the same thing in Snow Leopard? – Francis McGrew Oct 25 '11 at 11:36
2 Answers
If you set the NSScroller
to the "small" control size, either in IB or using -setControlSize:
, is that not the right thinness?

- 22,385
- 6
- 55
- 76
The release notes for Lion's version of AppKit outline when overlay scrollbars are and are not used:
Unless the user overrides scrollbar appearance using System Preferences, the following behavior occurs:
If all of the user’s pointing devices support both horizontal and vertical touch scrolling, the scrollbars are hidden during normal use. They appear as an overlay on top of the window’s content while the user is scrolling, and remain visible briefly to allow scrollbar dragging.
If the user has at least one external pointing device that does not support scrolling, the scrollbar is displayed at all times and the usable space in the window is reduced, as in previous versions of Mac OS X. (These permanent scrollbars are referred to as legacy scrollbars.)
If the user has no external pointing devices attached, the trackpad settings control the scrollbar behavior; if the user has disabled scrolling for the trackpad in System Preferences, legacy scrollbars are used.
Compatibility Note: There are three situations in which legacy scrollbars are used regardless of hardware or preferences:
An
NSScrollView
with accessory views inside its scroll trackAny subclass of
NSScroller
that does not declare itself to be overlay-scroller-compatibleAny
NSScroller
that is not managed by anNSScrollView
You should check if all the conditions are met on your machine and in your app.
You could also set the scroller style explicitly using NSScroller setScrollerStyle:, but it's probably better to respect the defaults and user preferences.

- 39,073
- 9
- 82
- 134