listable

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListRenderer

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

ListRenderer make a List widget which includes multi-line texts look like scrolled

func NewListRenderer

func NewListRenderer(opt *ListRendererOption) (l *ListRenderer)

NewListRenderer constructs a ListWrapper

func (*ListRenderer) AddBody

func (l *ListRenderer) AddBody(line string)

AddBody add an another line of text to ListWrapper.body

func (*ListRenderer) GetCursor

func (l *ListRenderer) GetCursor() int

GetCursor returns ListWrapper.cursor

func (*ListRenderer) MoveCursor

func (l *ListRenderer) MoveCursor(direction string) (items []string)

MoveCursor moves cursor position to "direction" with no focuse

func (*ListRenderer) MoveCursorWithFocus

func (l *ListRenderer) MoveCursorWithFocus(direction string) (items []string)

MoveCursorWithFocus moves cursor position to "direction" with a highlightened focus

func (*ListRenderer) RenderActually

func (l *ListRenderer) RenderActually() []string

RenderActually renders list

func (*ListRenderer) ResetRender

func (l *ListRenderer) ResetRender() (items []string)

ResetRender returns a initial multi-line texts

func (*ListRenderer) SetBody

func (l *ListRenderer) SetBody(items []string)

SetBody replace strings on ListWrapper.body

type ListRendererOption

type ListRendererOption struct {
	MaxH          int
	Header        []string
	Body          []string
	LineHighLight bool
}

ListRendererOption is the option argument for NewListWrapper

type ListWrapper

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

ListWrapper make a List widget which includes multi-line texts look like scrolled

func NewListWrapper

func NewListWrapper(opt *ListWrapperOption) (l *ListWrapper)

NewListWrapper constructs a ListWrapper

func (*ListWrapper) AddBody

func (l *ListWrapper) AddBody(line string)

AddBody add an another line of textto ListWrapper.body

func (*ListWrapper) GetCursor

func (l *ListWrapper) GetCursor() int

GetCursor returns ListWrapper.cursor

func (*ListWrapper) GetHeight

func (l *ListWrapper) GetHeight() int

GetHeight is the implementation of widget.Render

func (*ListWrapper) GetWidget

func (l *ListWrapper) GetWidget() ui.GridBufferer

GetWidget returns the instance of ui.List

func (*ListWrapper) GetWidth

func (l *ListWrapper) GetWidth() int

GetWidth is the implementation of widget.Render

func (*ListWrapper) MmoveCursorWithFocus

func (l *ListWrapper) MmoveCursorWithFocus(direction string)

MmoveCursorWithFocus moves cursor and update ui

func (*ListWrapper) MoveCursor

func (l *ListWrapper) MoveCursor(direction string)

MoveCursor moves cursor

func (*ListWrapper) Render

func (l *ListWrapper) Render()

Render display current *ui.List.Items

func (*ListWrapper) ResetRender

func (l *ListWrapper) ResetRender()

ResetRender returns a initial multi-line texts

func (*ListWrapper) SetBody

func (l *ListWrapper) SetBody(items []string)

SetBody replace strings on ListWrapper.body

type ListWrapperOption

type ListWrapperOption struct {
	Title         string
	RealHeight    int
	Header        []string
	Body          []string
	LineHighLight bool
}

ListWrapperOption is the option argument for NewListWrapper

Jump to

Keyboard shortcuts

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