Documentation ¶
Index ¶
- Variables
- func End()
- func External(name string, arg ...string)
- func Navigate(newwin *Window)
- func NewEventBase() events
- func PauseTermbox(blank bool)
- func PushWindow(win *Window)
- func ResumeTermbox()
- func StartTermbox(window *Window) error
- func StartTermboxBlocking(window *Window) error
- func StatusLine(text string)
- type Boxchars
- type Button
- type Checkbox
- type Checkgroup
- type Control
- type Controlbase
- type Event
- type Eventcontrol
- type Label
- type Listbox
- type Listelement
- type Textbox
- type Window
Constants ¶
This section is empty.
Variables ¶
View Source
var Box map[string]*Boxchars = map[string]*Boxchars{ "d": &Boxchars{ tl: '╔', tr: '╗', bl: '╚', br: '╝', v: '║', h: '═', }, "s": &Boxchars{ tl: '┌', tr: '┐', bl: '└', br: '┘', v: '│', h: '─', }, }
View Source
var Box2 map[string]rune = map[string]rune{
"shadow": '▒',
}
View Source
var WindowStack []*Window
Functions ¶
func Navigate ¶
func Navigate(newwin *Window)
Navigates to a new window, completeley erases the window stack in the process
func NewEventBase ¶
func NewEventBase() events
func PauseTermbox ¶
func PauseTermbox(blank bool)
Pauses the UI. Set blank to true to blank the console out (black) Set blank to false to keep the current screen
func PushWindow ¶
func PushWindow(win *Window)
Push Window onto the window stack. This allows showing windows on top of each other and going backwards again. (Like dialog windows)
func StartTermbox ¶
Starts with a window and returns instantly.
func StartTermboxBlocking ¶
Starts with a window and blocks
Types ¶
type Button ¶
type Button struct { Base Controlbase Text string Events events Box *Boxchars Shadow bool }
func NewButtonB ¶
func NewButtonB(base Controlbase, text string) *Button
func (*Button) B ¶
func (b *Button) B() *Controlbase
type Checkbox ¶
type Checkbox struct { Base Controlbase Events events Box *Boxchars Checkgroup *Checkgroup Text string // contains filtered or unexported fields }
func NewCheckbox ¶
func NewCheckbox() *Checkbox
func NewCheckboxB ¶
func NewCheckboxB(base Controlbase, text string) *Checkbox
func (*Checkbox) B ¶
func (b *Checkbox) B() *Controlbase
type Checkgroup ¶
func NewCheckgroup ¶
func NewCheckgroup() *Checkgroup
func (*Checkgroup) AddControl ¶
func (c *Checkgroup) AddControl(chk ...*Checkbox)
type Control ¶
type Control interface { B() *Controlbase Draw(*Window) }
type Eventcontrol ¶
type Eventcontrol interface { Control E() *events }
type Label ¶
type Label struct { Base Controlbase Text string Pageoffset int // contains filtered or unexported fields }
func NewLabelB ¶
func NewLabelB(base Controlbase, text string) *Label
func (*Label) B ¶
func (b *Label) B() *Controlbase
type Listbox ¶
type Listbox struct { Base Controlbase Caption string SelectedElement *list.Element SelectedIndex int Events events Box *Boxchars Stuff *list.List Shadow bool }
func NewListbox ¶
func NewListbox() *Listbox
func NewListboxB ¶
func NewListboxB(base Controlbase, Caption string) *Listbox
func (*Listbox) B ¶
func (b *Listbox) B() *Controlbase
type Listelement ¶
type Textbox ¶
type Textbox struct { Base Controlbase Text []rune Name string Events events Box *Boxchars Cursorpos int Maskchar rune // contains filtered or unexported fields }
func NewTextbox ¶
func NewTextbox() *Textbox
func NewTextboxB ¶
func NewTextboxB(base Controlbase, Name string) *Textbox
func (*Textbox) B ¶
func (b *Textbox) B() *Controlbase
type Window ¶
type Window struct { Controls []Control ControlMap map[string]Control DisplayControls []Control SelectedControlindex int SelectedControl Control Background termbox.Attribute Foreground termbox.Attribute SelectedBackground termbox.Attribute SelectedForeground termbox.Attribute Events events Caption string // contains filtered or unexported fields }
var CurrentWindow *Window
func PopWindow ¶
func PopWindow() *Window
Pops a window from the window stack. Focuses to the next window on the stack
func (*Window) AddControl ¶
func (*Window) AddDisplayControl ¶
func (*Window) ControlSelected ¶
func (*Window) SetBase ¶
func (win *Window) SetBase(c *Controlbase)
Click to show internal directories.
Click to hide internal directories.