Documentation ¶
Index ¶
- type Checkbox
- type Console
- func (c *Console) CheckBoxes(title string, subTitle string, els []Checkbox) bool
- func (c *Console) Close()
- func (c *Console) DrawString(x, y int, str string, style tcell.Style)
- func (c *Console) EventPoll(quit chan bool, eventHandler func(ev tcell.Event) bool)
- func (c *Console) Exit()
- func (c *Console) Radio(title string, subTitle string, choice int, els []string) int
- func (c *Console) UILoop(quit chan bool, render func()) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkbox ¶
Checkbox represents an item (typically in a group of two or more), that the user can tick on/off
type Console ¶
type Console struct { Screen tcell.Screen NoExitOnEscape bool // If true, then commands will not issue an os.Exit() if the user presses Escape. The user can still press Ctrl-C to perform an os.Exit() }
Console represents a terminal console that you can control for UI
func NewConsole ¶
func NewConsole() *Console
NewConsole creates a new console option, and initializes it. If anything fails, the function calls os.Exit(1) You must call Close() when you are finished using a console object, otherwise you will leave your user's terminal in an unusable state.
func (*Console) CheckBoxes ¶
Returns true if the user pressed enter to continue, or false in any other case.
func (*Console) DrawString ¶
DrawString is a helper function for drawing a string at a given location
func (*Console) EventPoll ¶
EventPoll is a helper function that runs a Goroutine to perform event handling, and handles common things such as ENTER press, ESCAPE, Ctrl-C, Ctrl-L. eventHandler returns true to indicate that it has handled the event, or false to pass control onto this function.
func (*Console) Exit ¶
func (c *Console) Exit()
Exit closes the console neatly, then does an os.Exit(1)