scrollabletext

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: 6 Imported by: 0

Documentation

Overview

Package scrollabletext provides a text widget that can be placed inside withscrollbar.Widget

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Widget

type Widget struct {
	*selectable.Widget
	// contains filtered or unexported fields
}

Widget constructs a text widget and allows it to be scrolled. But this widget is limited - it assumes no line will wrap. To make this happen it ensures that any lines that are too long are clipped. It makes this assumption because my scrollbar APIs are not well designed, and functions like ScrollPosition and ScrollLength don't understand the current rendering context. That means if the app is resized, and a line now takes two screen lines to render and not one, the scrollbar can't be built accurately. Until I design a better scrollbar API, this will work - I'm only using it for limited information dialogs at the moment.

func New

func New(txt string) *Widget

func (*Widget) Down

func (w *Widget) Down(lines int, size gowid.IRenderSize, app gowid.IApp)

func (*Widget) DownPage

func (w *Widget) DownPage(num int, size gowid.IRenderSize, app gowid.IApp)

func (*Widget) ScrollLength

func (w *Widget) ScrollLength() int

func (*Widget) ScrollPosition

func (w *Widget) ScrollPosition() int

Implement functions for withscrollbar.Widget

func (*Widget) Up

func (w *Widget) Up(lines int, size gowid.IRenderSize, app gowid.IApp)

func (*Widget) UpPage

func (w *Widget) UpPage(num int, size gowid.IRenderSize, app gowid.IApp)

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