common

package
v0.6.9-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBrowser

type FileBrowser struct {
	Dir string

	OnOpen  func(string)
	OnClick func(string)

	*tview.TreeView

	Root *tview.TreeNode
	Node *tview.TreeNode
}

func NewFileBrowser

func NewFileBrowser(dir string, onopen, onclick func(path string)) *FileBrowser

func (*FileBrowser) AddAt

func (FB *FileBrowser) AddAt(target *tview.TreeNode, path string)

func (*FileBrowser) OnDoubleClick

func (FB *FileBrowser) OnDoubleClick(node *tview.TreeNode)

func (*FileBrowser) OnSelect

func (FB *FileBrowser) OnSelect(node *tview.TreeNode)

type MapBrowser

type MapBrowser struct {
	Name string
	Data map[string]any

	OnOpen  func(string)
	OnClick func(string)

	LeafClick func(string)

	*tview.TreeView

	Root *tview.TreeNode
	Node *tview.TreeNode
}

func NewMapBrowser

func NewMapBrowser(name string, data map[string]any, onopen, onclick func(path string)) *MapBrowser

func (*MapBrowser) AddAt

func (C *MapBrowser) AddAt(target *tview.TreeNode, path string)

func (*MapBrowser) Decode

func (C *MapBrowser) Decode(map[string]any) (widget.Widget, error)

func (*MapBrowser) Encode

func (C *MapBrowser) Encode() (map[string]any, error)

func (*MapBrowser) OnLeafClick

func (C *MapBrowser) OnLeafClick(node *tview.TreeNode)

func (*MapBrowser) OnSelect

func (C *MapBrowser) OnSelect(node *tview.TreeNode)

func (*MapBrowser) TypeName

func (C *MapBrowser) TypeName() string

type Shell

type Shell struct {
	*tview.TextArea

	App *app.App
	// contains filtered or unexported fields
}

func NewShell

func NewShell(app *app.App) *Shell

func (*Shell) Append

func (S *Shell) Append(text string)

func (*Shell) Write

func (S *Shell) Write(text string)

type TextEditor

type TextEditor struct {
	*tview.TextView

	W io.Writer

	OnChange func()
}

func NewTextEditor

func NewTextEditor(onchange func()) *TextEditor

func (*TextEditor) Focus

func (ED *TextEditor) Focus(delegate func(p tview.Primitive))

func (*TextEditor) OpenFile

func (ED *TextEditor) OpenFile(path string)

Jump to

Keyboard shortcuts

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