termwindow

package module
v0.0.0-...-bf9ec5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	WINDOW_TOP   int = 0
	TITLE_HEIGHT int = 1
	MSG_HEIGHT   int = 1

	CL_TITLE_BG   = termbox.Attribute(uint16(0x12))
	CL_TITLE_FG   = termbox.Attribute(uint16(0xFD))
	CL_MSG_BG     = termbox.Attribute(uint16(0x12))
	CL_MSG_FG     = termbox.Attribute(uint16(0xFD))
	CL_ERR_BG     = termbox.Attribute(uint16(0x12))
	CL_ERR_FG     = termbox.Attribute(uint16(0xC5))
	CL_MENU_BG    = termbox.ColorDefault
	CL_MENU_FG    = termbox.ColorDefault
	CL_MENUACT_BG = termbox.Attribute(uint16(0x08))
	CL_MENUACT_FG = termbox.Attribute(uint16(0x17))
)
View Source
const (
	KeyCtrlTilde      termbox.Key = 0x00
	KeyCtrl2          termbox.Key = 0x00
	KeyCtrlSpace      termbox.Key = 0x00
	KeyCtrlA          termbox.Key = 0x01
	KeyCtrlB          termbox.Key = 0x02
	KeyCtrlC          termbox.Key = 0x03
	KeyCtrlD          termbox.Key = 0x04
	KeyCtrlE          termbox.Key = 0x05
	KeyCtrlF          termbox.Key = 0x06
	KeyCtrlG          termbox.Key = 0x07
	KeyBackspace      termbox.Key = 0x08
	KeyCtrlH          termbox.Key = 0x08
	KeyTab            termbox.Key = 0x09
	KeyCtrlI          termbox.Key = 0x09
	KeyCtrlJ          termbox.Key = 0x0A
	KeyCtrlK          termbox.Key = 0x0B
	KeyCtrlL          termbox.Key = 0x0C
	KeyEnter          termbox.Key = 0x0D
	KeyCtrlM          termbox.Key = 0x0D
	KeyCtrlN          termbox.Key = 0x0E
	KeyCtrlO          termbox.Key = 0x0F
	KeyCtrlP          termbox.Key = 0x10
	KeyCtrlQ          termbox.Key = 0x11
	KeyCtrlR          termbox.Key = 0x12
	KeyCtrlS          termbox.Key = 0x13
	KeyCtrlT          termbox.Key = 0x14
	KeyCtrlU          termbox.Key = 0x15
	KeyCtrlV          termbox.Key = 0x16
	KeyCtrlW          termbox.Key = 0x17
	KeyCtrlX          termbox.Key = 0x18
	KeyCtrlY          termbox.Key = 0x19
	KeyCtrlZ          termbox.Key = 0x1A
	KeyEsc            termbox.Key = 0x1B
	KeyCtrlLsqBracket termbox.Key = 0x1B
	KeyCtrl3          termbox.Key = 0x1B
	KeyCtrl4          termbox.Key = 0x1C
	KeyCtrlBackslash  termbox.Key = 0x1C
	KeyCtrl5          termbox.Key = 0x1D
	KeyCtrlRsqBracket termbox.Key = 0x1D
	KeyCtrl6          termbox.Key = 0x1E
	KeyCtrl7          termbox.Key = 0x1F
	KeyCtrlSlash      termbox.Key = 0x1F
	KeyCtrlUnderscore termbox.Key = 0x1F
	KeySpace          termbox.Key = 0x20
	KeyBackspace2     termbox.Key = 0x7F
	KeyCtrl8          termbox.Key = 0x7F
)

Variables

View Source
var (
	Key        chan EVKEY
	Title      chan []byte
	Menu       chan WinData
	ActiveLine chan int
	Body       chan WinData
	Msg        chan []byte
	Flush      chan struct{}
	Err        chan error
)

Functions

func Close

func Close() error

func Init

func Init() error

func Input

func Input(wk goctx.Worker)

func ReFlush

func ReFlush()

func SetActiveLine

func SetActiveLine(i int)

func SetBody

func SetBody(b WinData)

func SetErr

func SetErr(err error)

func SetErrStr

func SetErrStr(s string, msg ...interface{})

func SetMenu

func SetMenu(b WinData)

func SetMsg

func SetMsg(s string, msg ...interface{})

func SetTitle

func SetTitle(str string)

func Start

func Start(wk goctx.Worker)

func UnsetBody

func UnsetBody()

Types

type EVKEY

type EVKEY struct {
	Key termbox.Key
	Ch  rune
}

type WinData

type WinData struct {
	Title []byte
	Body  [][]byte
	Ids   []string
}

type Window

type Window struct {
	Active int
	Data   WinData
}

func (*Window) Append

func (self *Window) Append(id string, data []byte)

func (*Window) GetData

func (self *Window) GetData(act int) (string, []byte)

func (*Window) MvBottom

func (self *Window) MvBottom() int

func (*Window) MvDec

func (self *Window) MvDec() int

func (*Window) MvInc

func (self *Window) MvInc() int

func (*Window) MvTop

func (self *Window) MvTop() int

func (*Window) SetTitle

func (self *Window) SetTitle(s string, msg ...interface{})

Directories

Path Synopsis
sample
run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL