Documentation ¶
Index ¶
- Constants
- func ACS_BLOCK() uint32
- func ACS_BOARD() uint32
- func ACS_BTEE() uint32
- func ACS_BULLET() uint32
- func ACS_CKBOARD() uint32
- func ACS_DARROW() uint32
- func ACS_DEGREE() uint32
- func ACS_DIAMOND() uint32
- func ACS_HLINE() uint32
- func ACS_LANTERN() uint32
- func ACS_LARROW() uint32
- func ACS_LLCORNER() uint32
- func ACS_LRCORNER() uint32
- func ACS_LTEE() uint32
- func ACS_PLMINUS() uint32
- func ACS_PLUS() uint32
- func ACS_RARROW() uint32
- func ACS_RTEE() uint32
- func ACS_S1() uint32
- func ACS_S9() uint32
- func ACS_TTEE() uint32
- func ACS_UARROW() uint32
- func ACS_ULCORNER() uint32
- func ACS_URCORNER() uint32
- func ACS_VLINE() uint32
- func Addch(ch int)
- func Addstr(str ...interface{})
- func Attroff(attr int)
- func Attron(attr int)
- func Attrset(attr int)
- func COLORS() int
- func COLOR_PAIRS() int
- func CanChangeColor() bool
- func Cbreak()
- func Clear()
- func Echo()
- func End()
- func Erase()
- func Getch() int
- func Getmaxyx() (row, col int)
- func HasColors() bool
- func Mouseinterval(delay time.Duration) time.Duration
- func Move(y, x int)
- func Mvaddch(y, x int, ch int)
- func Mvaddstr(y, x int, str ...interface{})
- func Noecho()
- func Raw()
- func Refresh()
- func StartColor() error
- func Timeout(d time.Duration)
- func UseDefaultColors()
- type Color
- type ColorPair
- type MouseEvent
- type MouseMask
- type Window
- func (win *Window) Addch(ch int)
- func (win *Window) Addstr(str ...interface{})
- func (win *Window) Attroff(attr int)
- func (win *Window) Attron(attr int)
- func (win *Window) Attrset(attr int)
- func (win *Window) Border(ls, rs, ts, bs, tl, tr, bl, br int)
- func (win *Window) Box(v, h int)
- func (win *Window) Clear()
- func (win *Window) Clrtoeol()
- func (win *Window) Del()
- func (win *Window) Erase()
- func (win *Window) Getch() int
- func (win *Window) Getmaxyx() (row, col int)
- func (win *Window) Idlok(bf bool)
- func (win *Window) Keypad(on bool)
- func (win *Window) Mvaddch(y, x int, ch int)
- func (win *Window) Mvaddstr(y, x int, str ...interface{})
- func (win *Window) Refresh()
- func (win *Window) Scroll()
- func (win *Window) Scrollok(bf bool)
- func (win *Window) Setscrreg(top, bot int)
- func (win *Window) Timeout(d time.Duration)
- func (win *Window) Wmove(y, x int)
Constants ¶
const ( A_NORMAL = C.A_NORMAL A_ATTRIBUTES = C.A_ATTRIBUTES A_CHARTEXT = C.A_CHARTEXT A_COLOR = C.A_COLOR A_STANDOUT = C.A_STANDOUT A_UNDERLINE = C.A_UNDERLINE A_REVERSE = C.A_REVERSE A_BLINK = C.A_BLINK A_DIM = C.A_DIM A_BOLD = C.A_BOLD A_ALTCHARSET = C.A_ALTCHARSET A_INVIS = C.A_INVIS A_PROTECT = C.A_PROTECT A_HORIZONTAL = C.A_HORIZONTAL A_LEFT = C.A_LEFT A_LOW = C.A_LOW A_RIGHT = C.A_RIGHT A_TOP = C.A_TOP A_VERTICAL = C.A_VERTICAL )
Attributes
const ( KEY_DOWN = C.KEY_DOWN KEY_UP = C.KEY_UP KEY_LEFT = C.KEY_LEFT KEY_RIGHT = C.KEY_RIGHT KEY_RESIZE = C.KEY_RESIZE )
Keys
const ( BUTTON1_PRESSED C.mmask_t = C.BUTTON1_PRESSED BUTTON1_RELEASED = C.BUTTON1_RELEASED BUTTON1_CLICKED = C.BUTTON1_CLICKED BUTTON1_DOUBLE_CLICKED = C.BUTTON1_DOUBLE_CLICKED BUTTON1_TRIPLE_CLICKED = C.BUTTON1_TRIPLE_CLICKED BUTTON2_PRESSED = C.BUTTON2_PRESSED BUTTON2_RELEASED = C.BUTTON2_RELEASED BUTTON2_CLICKED = C.BUTTON2_CLICKED BUTTON2_DOUBLE_CLICKED = C.BUTTON2_DOUBLE_CLICKED BUTTON2_TRIPLE_CLICKED = C.BUTTON2_TRIPLE_CLICKED BUTTON3_PRESSED = C.BUTTON3_PRESSED BUTTON3_RELEASED = C.BUTTON3_RELEASED BUTTON3_CLICKED = C.BUTTON3_CLICKED BUTTON3_DOUBLE_CLICKED = C.BUTTON3_DOUBLE_CLICKED BUTTON3_TRIPLE_CLICKED = C.BUTTON3_TRIPLE_CLICKED BUTTON4_PRESSED = C.BUTTON4_PRESSED BUTTON4_RELEASED = C.BUTTON4_RELEASED BUTTON4_CLICKED = C.BUTTON4_CLICKED BUTTON4_DOUBLE_CLICKED = C.BUTTON4_DOUBLE_CLICKED BUTTON4_TRIPLE_CLICKED = C.BUTTON4_TRIPLE_CLICKED BUTTON_SHIFT = C.BUTTON_SHIFT BUTTON_CTRL = C.BUTTON_CTRL BUTTON_ALT = C.BUTTON_ALT ALL_MOUSE_EVENTS = C.ALL_MOUSE_EVENTS REPORT_MOUSE_POSITION = C.REPORT_MOUSE_POSITION )
const ERR = C.ERR
Error return value
const (
KEY_MOUSE = C.KEY_MOUSE
)
Variables ¶
This section is empty.
Functions ¶
func ACS_BULLET ¶
func ACS_BULLET() uint32
func ACS_CKBOARD ¶
func ACS_CKBOARD() uint32
func ACS_DARROW ¶
func ACS_DARROW() uint32
func ACS_DEGREE ¶
func ACS_DEGREE() uint32
func ACS_DIAMOND ¶
func ACS_DIAMOND() uint32
func ACS_LANTERN ¶
func ACS_LANTERN() uint32
func ACS_LARROW ¶
func ACS_LARROW() uint32
func ACS_LLCORNER ¶
func ACS_LLCORNER() uint32
func ACS_LRCORNER ¶
func ACS_LRCORNER() uint32
func ACS_PLMINUS ¶
func ACS_PLMINUS() uint32
func ACS_RARROW ¶
func ACS_RARROW() uint32
func ACS_UARROW ¶
func ACS_UARROW() uint32
func ACS_ULCORNER ¶
func ACS_ULCORNER() uint32
func ACS_URCORNER ¶
func ACS_URCORNER() uint32
func COLOR_PAIRS ¶
func COLOR_PAIRS() int
COLOR_PAIRS is the maximum number of color pairs that curses can support.
func CanChangeColor ¶
func CanChangeColor() bool
CanChangeColor returns true if the terminal supports more than the default 8-bit colors.
func Mouseinterval ¶
Sets and returns the max time, between click and release, that can be considered a click. The finest resolution available is milliseconds. Pass -1 to obtain the current value without changing it. Pass 0 to disable click resolution.
func StartColor ¶
func StartColor() error
StartColor must be called before calling any other color-related functions (including COLORS/COLOR_PAIRS).
Types ¶
type Color ¶
type Color int
Colors; the value of Color must be less t han COLORS().
const ( COLOR_BLACK Color = C.COLOR_BLACK COLOR_RED Color = C.COLOR_RED COLOR_GREEN Color = C.COLOR_GREEN COLOR_YELLOW Color = C.COLOR_YELLOW COLOR_BLUE Color = C.COLOR_BLUE COLOR_MAGENTA Color = C.COLOR_MAGENTA COLOR_CYAN Color = C.COLOR_CYAN COLOR_WHITE Color = C.COLOR_WHITE COLOR_DEFAULT Color = Color(-1) )
func (Color) Init ¶
Init initializes a given color ID with the specified rgb triplet. The values of r, g, and b must be within 0 and 1000, inclusive. This method does nothing if !CanChangeColor. Changing an existing color will flush curses' screen buffer, causing a full redraw on next refresh. This method only really works iff TERM=xterm-256color (maybe others, depends heavily on termcaps).
type ColorPair ¶
type ColorPair int
ColorPair is an id for a specific color pair (foreground/background). The value must be less than COLOR_PAIRS.
type MouseEvent ¶
func Getmouse ¶
func Getmouse() *MouseEvent
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Curses window type.
func Initscr ¶
func Initscr() *Window
Initializes curses. This function should be called before using the package.
func (*Window) Border ¶
Set border characters. 1. ls: character to be used for the left side of the window 2. rs: character to be used for the right side of the window 3. ts: character to be used for the top side of the window 4. bs: character to be used for the bottom side of the window 5. tl: character to be used for the top left corner of the window 6. tr: character to be used for the top right corner of the window 7. bl: character to be used for the bottom left corner of the window 8. br: character to be used for the bottom right corner of the window
func (*Window) Clrtoeol ¶
func (win *Window) Clrtoeol()
Erases content from cursor to end of line inclusive.