scrollbar

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BarWidth  = 20 //竖滚动条宽度
	BarHeight = 50 //竖滚动条高度
)
View Source
const OffsetResolution = 100

OffsetResolution indicate max value of the scroll offset

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetChangeHandler

type OffsetChangeHandler func(newoffset uint32)

OffsetChangeHandler is the type handler function get called whenever scroller offset changes

type ScrollBar

type ScrollBar struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

ScrollBar is the fyne widget for scroll bar

func NewSBar

func NewSBar(handler OffsetChangeHandler, h bool) *ScrollBar

NewSBar returns a new scrollbar instance, with the specified handler function handler, could be nil; horizontal scrollbar if h is true, vertical otherwise;

func (*ScrollBar) CreateRenderer

func (sbar *ScrollBar) CreateRenderer() fyne.WidgetRenderer

CreateRenderer implments fyne.Widget interface

func (*ScrollBar) DragEnd

func (sbar *ScrollBar) DragEnd()

DragEnd implements fyne.Draggable interface

func (*ScrollBar) Dragged

func (sbar *ScrollBar) Dragged(evt *fyne.DragEvent)

Dragged implements fyne.Draggable interface

func (*ScrollBar) GetOffset

func (sbar *ScrollBar) GetOffset() uint32

GetOffset returns current offset

func (*ScrollBar) IsHorizontal

func (sbar *ScrollBar) IsHorizontal() bool

IsHorizontal returns true if it is horizontal scroll bar

func (*ScrollBar) SetOffset

func (sbar *ScrollBar) SetOffset(o uint32)

SetOffset set the scroll offset; note this function won't trigger the OffsetChangeHandler function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL