tui

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int
const (
	LevelInfo  Level = iota // LevelInfo is for information messages written to the event view
	LevelError              // LevelError is for error messages written to the event view
)

type TUI

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

TUI is the application's tview terminal UI.

func New

func New() *TUI

New returns a new tui.

func (*TUI) ClearEvents

func (t *TUI) ClearEvents()

ClearEvents removes all text from the event view.

func (*TUI) ClearInputText

func (t *TUI) ClearInputText()

ClearInputText clears the current content of the input field.

func (*TUI) InputText

func (t *TUI) InputText() string

InputText returns the current content of the input field.

func (*TUI) RunApp

func (t *TUI) RunApp() error

RunApp starts the application and the main event loop.

func (*TUI) SetInputCapture

func (t *TUI) SetInputCapture(captureFunc func(capture *tcell.EventKey) *tcell.EventKey)

SetInputCapture sets the capture function for key events in the input field.

func (*TUI) StopApp

func (t *TUI) StopApp()

StopApp stops the application, causing RunApp() to return.

func (*TUI) WriteEvent

func (t *TUI) WriteEvent(level Level, message string)

WriteEvent writes messages to the event view. WriteEvent prepends a UTC timestamp and a short line prefix indicating if the message is information or an error.

Jump to

Keyboard shortcuts

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