diff --git a/scrollbar.go b/scrollbar.go index 2f3cdf6..2f71248 100644 --- a/scrollbar.go +++ b/scrollbar.go @@ -6,6 +6,8 @@ import "git.tebibyte.media/tomo/tomo/theme" import "git.tebibyte.media/tomo/tomo/input" import "git.tebibyte.media/tomo/tomo/event" +// Scrollbar is a special type of slider that can control the scroll of any +// overflowing ContainerBox. type Scrollbar struct { tomo.ContainerBox handle *SliderHandle @@ -49,14 +51,18 @@ func newScrollbar (orient string) *Scrollbar { return this } +// NewVerticalScrollbar creates a new vertical scrollbar. func NewVerticalScrollbar () *Scrollbar { return newScrollbar("vertical") } +// NewHorizontalScrollbar creates a new horizontal scrollbar. func NewHorizontalScrollbar () *Scrollbar { return newScrollbar("horizontal") } +// Link assigns this scrollbar to a ContentBox. Closing the returned cookie will +// unlink it. func (this *Scrollbar) Link (box tomo.ContentBox) event.Cookie { this.layout.linked = box this.linkCookie = this.newLinkCookie (