Categorygithub.com/tomyl/xui
modulepackage
0.0.0-20200116202820-ceb8cf202bb3
Repository: https://github.com/tomyl/xui.git
Documentation: pkg.go.dev

# README

xui

GoDoc Go Report Card

A console user interface toolkit based on gocui (but currently uses my branch). Used by mört.

Pre-alpha software. Expect plenty of bugs and frequent breaking API changes.

TODO

  • Explain why this project was needed.
  • Add documentation.
  • Add examples.
  • Finish this TODO list.

# Functions

Error builds an widget action error.
ErrorHandler returns a gocui keybinding handler that returns provided error.
GetLine returns currently selected line for a view (relative to origin).
Handler returns a gocui keybinding handler that executes provided function and returns a nil error.
MoveLines changes selected line of a view.
New wraps a gocui.Gui instance.
Pad appends spaces to provided string so that its length matches the width of the widget, while taking double-width unicode characters and ANSI escape sequences into account.
PromptEditor builds a gocui.Editor function letting user enter a line of text.
ResizeLayout calls provided layout function if view was resized.
StringWidth returns the width of string in single-width unicode character units.
UnknownAction builds an widget action error indicating that the widget didn't understand the action.

# Constants

Widget movements.
Widget movements.
Widget movements.
Widget movements.

# Structs

ErrAction represents an error encountered during a widet action.
A ListWidget displays a list of lines.
A Region represents the area occupied by a gocui.View without the outer frame.
ScrollWidget provides vertical scrolling to other widgets.
A TextWidget displays a string.
Xui is a wrapper around gocui.Gui.

# Interfaces

A Widget can be bound to gocui.View and handle action commands.