NSScroller with transparent Background

I’d like to hide the background rect of a ScrollBar on macOS. Looks like NSScroller has drawKnob() Method.

Does anyone have a declare for this? Should be possible: How to draw a transparent NSScroller


MBS and Ohanaware AppKit has this.
I don’t think you can achieve this with the Xojo scrollbar (which is odd though)

1 Like

The transparent background of a NSSlider is not a property.

Makes me think why Xojo does not use NSScroller instead of NSSlider. Backwards compatibility?

Why do you assume that Scrollbar is derived from NSSlider? In my opinion it is an NSScroller.

My bad… I meant NSScroller, not NSSlider.

I opened <https://xojo.com/issue/62861> since there doesn’t seem to be a solution to this without relying on a control that cannot work on other platforms.

1 Like

The solution that is shown in the screenshot uses a Xojo Scrollbar. So it will work on other platforms, but they will get the slider track.

If you’d like to know how it is done, the source code is in the Ohanaware App Kit and is used by the OWScrollView, OWStackView and OWGridView, as well as having a ScrollBar you can use whereever.

1 Like