withscrollbar

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package withscrollbar provides a widget that renders with a scrollbar on the right

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMenuRows

func CalculateMenuRows(vals IScrollValues, rows int, focus gowid.Selector, app gowid.IApp) (int, int, int)

Don't attempt to calculate actual rendered rows - it's terribly slow, and O(n) rows.

Types

type IScrollHome added in v2.1.0

type IScrollHome interface {
	GoHome(size gowid.IRenderSize, app gowid.IApp)
}

type IScrollOneLine added in v2.0.3

type IScrollOneLine interface {
	Up(lines int, size gowid.IRenderSize, app gowid.IApp)
	Down(lines int, size gowid.IRenderSize, app gowid.IApp)
}

Implemented by widgets that can scroll

type IScrollOnePage added in v2.0.3

type IScrollOnePage interface {
	UpPage(num int, size gowid.IRenderSize, app gowid.IApp)
	DownPage(num int, size gowid.IRenderSize, app gowid.IApp)
}

type IScrollSubWidget

type IScrollSubWidget interface {
	gowid.IWidget
	IScrollValues
	IScrollOneLine
	IScrollOnePage
}

type IScrollToEnd added in v2.1.0

type IScrollToEnd interface {
	GoToEnd(size gowid.IRenderSize, app gowid.IApp)
}

type IScrollValues

type IScrollValues interface {
	ScrollPosition() int
	ScrollLength() int
}

type Options added in v2.0.3

type Options struct {
	HideIfContentFits bool
}

type Widget

type Widget struct {
	// contains filtered or unexported fields
}

func New

func New(w IScrollSubWidget, opts ...Options) *Widget

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func (*Widget) RenderSize added in v2.0.3

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) Selectable added in v2.0.3

func (w *Widget) Selectable() bool

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Jump to

Keyboard shortcuts

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