Documentation ¶
Overview ¶
@author Axel Anceau - 2014 Package termgow allows to creates console apps faster
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic interface { Size() (int, int) GetForeground() termbox.Attribute GetBackground() termbox.Attribute }
Basic interface contains all methods that every basic element must implements
type Container ¶
type Container struct { Element // contains filtered or unexported fields }
A container is a visual basic element
func (*Container) RemoveBorder ¶
func (c *Container) RemoveBorder()
RemoveBorder removes the border from the container (if any)
func (*Container) SetAlignment ¶
SetAlignment sets the alignment of the container
func (*Container) SetBorder ¶
func (c *Container) SetBorder(style *styles.BorderStyle)
SetBorder sets the border style of the container
func (*Container) SetMargin ¶
SetMargin sets the margin (in terms of chars) for every bounds of the window
Note : If an element has a specified x/y pos, the margin will not be considered
func (*Container) SetPadding ¶
SetPadding sets the padding (in terms of chars) for every bounds of the window
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Most basic type. Everything is an element
func (*Element) GetBackground ¶
func (e *Element) GetBackground() termbox.Attribute
GetBackground gets background's color
func (*Element) GetForeground ¶
func (e *Element) GetForeground() termbox.Attribute
GetForeground gets foreground (chars) color
func (*Element) SetBackground ¶
func (e *Element) SetBackground(color termbox.Attribute)
SetBackground changes background's color
func (*Element) SetForeground ¶
func (e *Element) SetForeground(color termbox.Attribute)
SetForeground sets foreground's color (characters)
type Layout ¶
Layout interface contains methods that a layout must implement to be able to manage a set of widgets
type Program ¶
type Program struct { Element IsRunning bool // If the program is currently running or not // contains filtered or unexported fields }
General informations about the program
func NewProgram ¶
NewProgram creates a new Program (only one program is allowed)
func (*Program) AddWindow ¶
AddWindow adds a new window to the set of window to print An error is returned if the window already exists
func (*Program) Close ¶
func (p *Program) Close()
Close the program. Must be called when the program is not needed anymore
func (*Program) RemoveWindow ¶
RemoveWindow removes a window from the program An error is returned if the window does not exists
Notes ¶
Bugs ¶
deleting win.priority from p.showed hides all other windows when .show() is called back delete(p.showed, win.priority)