Scroll

Show a part of view with scrollbar.

Modulerequire("gui")
TypeClass
InheritsView

The Scroll view can show an arbitrary content view inside it.

When the content is larger than the Scroll view, scrollbars will be optionally showed. When the content view is smaller then the Scroll view, the content view will be resized to the size of the Scroll view.

Class methods

create()

Create a new Scroll view.

Return

Scroll

Methods

setContentView(view)

Set the content view.

Parameters

getContentView()

Return the content view.

Return

View

setContentSize(size)

Set the size of content view.

Parameters

getContentSize()

Return the size of content view.

Return

SizeF

setOverlayScrollbar(overlay) macOS linux

Set whether to use overlay scrolling.

Parameters

isOverlayScrollbar() macOS linux

Return whether overlay scrolling is used.

Return

Boolean

setScrollbarPolicy(hpolicy, vpolicy)

Set the policy for displaying horizontal and vertical scrollbars.

Parameters

getScrollbarPolicy()

Return the display policy of horizontal and vertical scrollbars.

Return

[Scroll::Policy, Scroll::Policy]

setScrollElasticity(helasticity, velasticity) macOS

Set horizontal and vertical scroll elasticity (bounce).

Parameters

getScrollElasticity() macOS

Return the horizontal and vertical scroll elasticity.

Return

[Scroll::Elasticity, Scroll::Elasticity]