newt

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

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

Go to latest
Published: Sep 28, 2014 License: BSD-3-Clause Imports: 3 Imported by: 0

README

go-newt

Newt bindings for Go language

Documentation

Overview

The newt package implements bindings to Erik Troan's newt library.

Index

Constants

View Source
const (
	EXIT_HOTKEY = iota
	EXIT_COMPONENT
	EXIT_FDREADY
	EXIT_TIMER
	EXIT_ERROR
)
View Source
const (
	ColorsetRoot           = C.NEWT_COLORSET_ROOT
	COLORSET_ROOT          = C.NEWT_COLORSET_ROOT
	ColorsetBorder         = C.NEWT_COLORSET_BORDER
	COLORSET_BORDER        = C.NEWT_COLORSET_BORDER
	ColorsetWindow         = C.NEWT_COLORSET_WINDOW
	COLORSET_WINDOW        = C.NEWT_COLORSET_WINDOW
	ColorsetShadow         = C.NEWT_COLORSET_SHADOW
	COLORSET_SHADOW        = C.NEWT_COLORSET_SHADOW
	ColorsetTitle          = C.NEWT_COLORSET_TITLE
	COLORSET_TITLE         = C.NEWT_COLORSET_TITLE
	ColorsetButton         = C.NEWT_COLORSET_BUTTON
	COLORSET_BUTTON        = C.NEWT_COLORSET_BUTTON
	ColorsetActButton      = C.NEWT_COLORSET_ACTBUTTON
	COLORSET_ACTBUTTON     = C.NEWT_COLORSET_ACTBUTTON
	ColorsetCheckbox       = C.NEWT_COLORSET_CHECKBOX
	COLORSET_CHECKBOX      = C.NEWT_COLORSET_CHECKBOX
	ColorsetActCheckbox    = C.NEWT_COLORSET_ACTCHECKBOX
	COLORSET_ACTCHECKBOX   = C.NEWT_COLORSET_ACTCHECKBOX
	ColorsetEntry          = C.NEWT_COLORSET_ENTRY
	COLORSET_ENTRY         = C.NEWT_COLORSET_ENTRY
	ColorsetLabel          = C.NEWT_COLORSET_LABEL
	COLORSET_LABEL         = C.NEWT_COLORSET_LABEL
	ColorsetListbox        = C.NEWT_COLORSET_LISTBOX
	COLORSET_LISTBOX       = C.NEWT_COLORSET_LISTBOX
	ColorsetActListbox     = C.NEWT_COLORSET_ACTLISTBOX
	COLORSET_ACTLISTBOX    = C.NEWT_COLORSET_ACTLISTBOX
	ColorsetTextbox        = C.NEWT_COLORSET_TEXTBOX
	COLORSET_TEXTBOX       = C.NEWT_COLORSET_TEXTBOX
	ColorsetActTextbox     = C.NEWT_COLORSET_ACTTEXTBOX
	COLORSET_ACTTEXTBOX    = C.NEWT_COLORSET_ACTTEXTBOX
	ColorsetHelpLine       = C.NEWT_COLORSET_HELPLINE
	COLORSET_HELPLINE      = C.NEWT_COLORSET_HELPLINE
	ColorsetRootText       = C.NEWT_COLORSET_ROOTTEXT
	COLORSET_ROOTTEXT      = C.NEWT_COLORSET_ROOTTEXT
	ColorsetEmptyScale     = C.NEWT_COLORSET_EMPTYSCALE
	COLORSET_EMPTYSCALE    = C.NEWT_COLORSET_EMPTYSCALE
	ColorsetFullScale      = C.NEWT_COLORSET_FULLSCALE
	COLORSET_FULLSCALE     = C.NEWT_COLORSET_FULLSCALE
	ColorsetDisEntry       = C.NEWT_COLORSET_DISENTRY
	COLORSET_DISENTRY      = C.NEWT_COLORSET_DISENTRY
	ColorsetCompactButton  = C.NEWT_COLORSET_COMPACTBUTTON
	COLORSET_COMPACTBUTTON = C.NEWT_COLORSET_COMPACTBUTTON
	ColorsetActSelListbox  = C.NEWT_COLORSET_ACTSELLISTBOX
	COLORSET_ACTSELLISTBOX = C.NEWT_COLORSET_ACTSELLISTBOX
	ColorsetSelListbox     = C.NEWT_COLORSET_SELLISTBOX
	COLORSET_SELLISTBOX    = C.NEWT_COLORSET_SELLISTBOX

	ARG_LAST   = C.NEWT_ARG_LAST
	ARG_APPEND = C.NEWT_ARG_APPEND

	FLAG_RETURNEXIT = C.NEWT_FLAG_RETURNEXIT
	FlagReturnExit  = C.NEWT_FLAG_RETURNEXIT
	FLAG_HIDDEN     = C.NEWT_FLAG_HIDDEN
	FlagHidden      = C.NEWT_FLAG_HIDDEN
	FLAG_SCROLL     = C.NEWT_FLAG_SCROLL
	FlagScroll      = C.NEWT_FLAG_SCROLL
	FLAG_DISABLED   = C.NEWT_FLAG_DISABLED
	FlagDisabled    = C.NEWT_FLAG_DISABLED
	FLAG_BORDER     = C.NEWT_FLAG_BORDER
	FlagBorder      = C.NEWT_FLAG_BORDER
	FLAG_WRAP       = C.NEWT_FLAG_WRAP
	FlagWrap        = C.NEWT_FLAG_WRAP
	FLAG_NOF12      = C.NEWT_FLAG_NOF12
	FlagNoF12       = C.NEWT_FLAG_NOF12
	FLAG_MULTIPLE   = C.NEWT_FLAG_MULTIPLE
	FlagMultiple    = C.NEWT_FLAG_MULTIPLE
	FLAG_SELECTED   = C.NEWT_FLAG_SELECTED
	FlagSelected    = C.NEWT_FLAG_SELECTED
	FLAG_CHECKBOX   = C.NEWT_FLAG_CHECKBOX
	FlagCheckbox    = C.NEWT_FLAG_CHECKBOX
	FLAG_PASSWORD   = C.NEWT_FLAG_PASSWORD
	FlagPassword    = C.NEWT_FLAG_PASSWORD
	FLAG_SHOWCURSOR = C.NEWT_FLAG_SHOWCURSOR
	FlagShowCursor  = C.NEWT_FLAG_SHOWCURSOR

	FD_READ   = C.NEWT_FD_READ
	FD_WRITE  = C.NEWT_FD_WRITE
	FD_EXCEPT = C.NEWT_FD_EXCEPT

	CHECKBOXTREE_UNSELECTABLE = C.NEWT_CHECKBOXTREE_UNSELECTABLE
	CHECKBOXTREE_HIDE_BOX     = C.NEWT_CHECKBOXTREE_HIDE_BOX
	CHECKBOXTREE_COLLAPSED    = C.NEWT_CHECKBOXTREE_COLLAPSED
	CHECKBOXTREE_EXPANDED     = C.NEWT_CHECKBOXTREE_EXPANDED
	CHECKBOXTREE_UNSELECTED   = C.NEWT_CHECKBOXTREE_UNSELECTED
	CHECKBOXTREE_SELECTED     = C.NEWT_CHECKBOXTREE_SELECTED

	LISTBOX_RETURNEXIT = C.NEWT_LISTBOX_RETURNEXIT
	ENTRY_SCROLL       = C.NEWT_ENTRY_SCROLL
	ENTRY_HIDDEN       = C.NEWT_ENTRY_HIDDEN
	ENTRY_RETURNEXIT   = C.NEWT_ENTRY_RETURNEXIT
	ENTRY_DISABLED     = C.NEWT_ENTRY_DISABLED

	TEXTBOX_WRAP   = C.NEWT_TEXTBOX_WRAP
	TEXTBOX_SCROLL = C.NEWT_TEXTBOX_SCROLL
	FORM_NOF12     = C.NEWT_FORM_NOF12

	ANCHOR_LEFT   = C.NEWT_ANCHOR_LEFT
	ANCHOR_RIGHT  = C.NEWT_ANCHOR_RIGHT
	ANCHOR_TOP    = C.NEWT_ANCHOR_TOP
	ANCHOR_BOTTOM = C.NEWT_ANCHOR_BOTTOM

	GRID_FLAG_GROWX = C.NEWT_GRID_FLAG_GROWX
	GRID_FLAG_GROWY = C.NEWT_GRID_FLAG_GROWY
)
View Source
const (
	KEY_TAB        = C.NEWT_KEY_TAB
	KEY_ENTER      = C.NEWT_KEY_ENTER
	KEY_SUSPEND    = C.NEWT_KEY_SUSPEND
	KEY_ESCAPE     = C.NEWT_KEY_ESCAPE
	KEY_RETURN     = C.NEWT_KEY_RETURN
	KEY_EXTRA_BASE = C.NEWT_KEY_EXTRA_BASE
	KEY_UP         = C.NEWT_KEY_UP
	KEY_DOWN       = C.NEWT_KEY_DOWN
	KEY_LEFT       = C.NEWT_KEY_LEFT
	KEY_RIGHT      = C.NEWT_KEY_RIGHT
	KEY_BKSPC      = C.NEWT_KEY_BKSPC
	KEY_DELETE     = C.NEWT_KEY_DELETE
	KEY_HOME       = C.NEWT_KEY_HOME
	KEY_END        = C.NEWT_KEY_END
	KEY_UNTAB      = C.NEWT_KEY_UNTAB
	KEY_PGUP       = C.NEWT_KEY_PGUP
	KEY_PGDN       = C.NEWT_KEY_PGDN
	KEY_INSERT     = C.NEWT_KEY_INSERT
	KEY_F1         = C.NEWT_KEY_F1
	KEY_F2         = C.NEWT_KEY_F2
	KEY_F3         = C.NEWT_KEY_F3
	KEY_F4         = C.NEWT_KEY_F4
	KEY_F5         = C.NEWT_KEY_F5
	KEY_F6         = C.NEWT_KEY_F6
	KEY_F7         = C.NEWT_KEY_F7
	KEY_F8         = C.NEWT_KEY_F8
	KEY_F9         = C.NEWT_KEY_F9
	KEY_F10        = C.NEWT_KEY_F10
	KEY_F11        = C.NEWT_KEY_F11
	KEY_F12        = C.NEWT_KEY_F12
	KEY_RESIZE     = C.NEWT_KEY_RESIZE
	KEY_ERROR      = C.NEWT_KEY_ERROR
)
View Source
const (
	GRID_EMPTY = iota
	GRID_COMPONENT
	GRID_SUBGRID
)
View Source
const (
	CMP_NONE = iota
	CMP_BUTTON
	CMP_BUTTONBAR
	CMP_CHECKBOX
	CMP_CHECKBOXTREE
	CMP_COMPACTBUTTON
	CMP_ENTRY
	CMP_FORM
	CMP_GRID
	CMP_LABEL
	CMP_LISTBOX
	CMP_RADIOBUTTON
	CMP_SCALE
	CMP_SCROLLBAR
	CMP_TEXTBOX
)

Variables

This section is empty.

Functions

func Bell

func Bell()

func CenteredWindow

func CenteredWindow(width, height uint, title string) int

func CheckboxGetValue

func CheckboxGetValue(c Component) int

func CheckboxSetFlags

func CheckboxSetFlags(c Component, flags int, sense uint32)

func CheckboxSetValue

func CheckboxSetValue(c Component, value int)

func CheckboxTreeAddArray

func CheckboxTreeAddArray(c Component, text string, data uintptr, flags int, indexes []int) int

func CheckboxTreeAddItem

func CheckboxTreeAddItem(c Component, text string, data uintptr, flags int, index int) int

func CheckboxTreeFindItem

func CheckboxTreeFindItem(c Component, data uintptr) int

func CheckboxTreeGetCurrent

func CheckboxTreeGetCurrent(c Component) uintptr

func CheckboxTreeGetEntryValue

func CheckboxTreeGetEntryValue(c Component) (int, uintptr)

func CheckboxTreeGetMultiSelection

func CheckboxTreeGetMultiSelection(c Component, seqnum int) (int, *uintptr)

func CheckboxTreeGetSelection

func CheckboxTreeGetSelection(c Component) (int, *uintptr)

func CheckboxTreeSetCurrent

func CheckboxTreeSetCurrent(c Component, item uintptr)

func CheckboxTreeSetEntry

func CheckboxTreeSetEntry(c Component, data uintptr, text string)

func CheckboxTreeSetEntryValue

func CheckboxTreeSetEntryValue(c Component, data uintptr, value int)

func CheckboxTreeSetWidth

func CheckboxTreeSetWidth(c Component, width int)

func ClearKeyBuffer

func ClearKeyBuffer()

func Cls

func Cls()

func ComponentAddCallback

func ComponentAddCallback(c Component, f Callback, data []byte)

func ComponentAddDestroyCallback

func ComponentAddDestroyCallback(c Component, f Callback, data []byte)

func ComponentDestroy

func ComponentDestroy(c Component)

func ComponentGetPosition

func ComponentGetPosition(c Component) (int, int)

func ComponentGetSize

func ComponentGetSize(c Component) (int, int)

func ComponentTakesFocus

func ComponentTakesFocus(c Component, val int)

func CursorOff

func CursorOff()

func CursorOn

func CursorOn()

func Delay

func Delay(usecs uint)

func DrawForm

func DrawForm(form Component)

func DrawRootText

func DrawRootText(col, row int, text string)

func EntryGetCursorPosition

func EntryGetCursorPosition(c Component) int

func EntryGetValue

func EntryGetValue(c Component) string

func EntrySet

func EntrySet(c Component, value string, cursorAtEnd int)

func EntrySetColors

func EntrySetColors(c Component, normal, disabled int)

func EntrySetCursorPosition

func EntrySetCursorPosition(c Component, position int)

func EntrySetFilter

func EntrySetFilter(c Component, filter uintptr, data []byte)

func EntrySetFlags

func EntrySetFlags(c Component, flags int, sense uint32)

func Finished

func Finished() int

func FormAddComponent

func FormAddComponent(form, c Component)

func FormAddComponents

func FormAddComponents(form Component, args ...Component)

func FormAddHotKey

func FormAddHotKey(c Component, key int)

func FormDestroy

func FormDestroy(c Component)

func FormGetScrollPosition

func FormGetScrollPosition(c Component) int

func FormSetBackground

func FormSetBackground(c Component, color int)

func FormSetCurrent

func FormSetCurrent(form, c Component)

func FormSetHeight

func FormSetHeight(c Component, height int)

func FormSetScrollPosition

func FormSetScrollPosition(c Component, position int)

func FormSetSize

func FormSetSize(c Component)

func FormSetTimer

func FormSetTimer(form Component, millisecs int)

func FormSetWidth

func FormSetWidth(c Component, width int)

func FormWatchFd

func FormWatchFd(form Component, fd, fdFlags int)

func GetScreenSize

func GetScreenSize() (int, int)

Components

func GridAddComponentsToForm

func GridAddComponentsToForm(grid, form Component, recurse int)

func GridDestroy

func GridDestroy(c Component, recurse int)

func GridFree

func GridFree(c Component, recurse int)

func GridGetSize

func GridGetSize(c Component) (int, int)

func GridPlace

func GridPlace(c Component, left, top int)

func GridSetField

func GridSetField(c Component, col, row int, typ uint32, val Component, padLeft, padTop, padRight, padBottom, anchor, flags int)

func GridWrappedWindow

func GridWrappedWindow(c Component, title string)

func GridWrappedWindowAt

func GridWrappedWindowAt(c Component, title string, left, top int)

func Init

func Init() int

func LabelSetColors

func LabelSetColors(c Component, colorset int)

func LabelSetText

func LabelSetText(c Component, text string)

func ListboxAddEntry

func ListboxAddEntry(c Component, text string, data uintptr) int

func ListboxAppendEntry

func ListboxAppendEntry(c Component, text string, data uintptr) int

func ListboxClear

func ListboxClear(c Component)

func ListboxClearSelection

func ListboxClearSelection(c Component)

func ListboxDeleteEntry

func ListboxDeleteEntry(c Component, data uintptr) int

func ListboxGetCurrent

func ListboxGetCurrent(c Component) uintptr

func ListboxGetEntry

func ListboxGetEntry(c Component, num int) (string, uintptr)

func ListboxGetSelection

func ListboxGetSelection(c Component) (int, []uintptr)

func ListboxInsertEntry

func ListboxInsertEntry(c Component, text string, data, key uintptr) int

func ListboxItemCount

func ListboxItemCount(c Component) int

func ListboxSelectItem

func ListboxSelectItem(c Component, key uintptr, sense uint32)

func ListboxSetCurrent

func ListboxSetCurrent(c Component, num int)

func ListboxSetCurrentByKey

func ListboxSetCurrentByKey(c Component, key uintptr)

func ListboxSetData

func ListboxSetData(c Component, num int, data uintptr)

func ListboxSetEntry

func ListboxSetEntry(c Component, num int, text string)

func ListboxSetWidth

func ListboxSetWidth(c Component, width int)

func OpenWindow

func OpenWindow(left, top int, width, height uint, title string) int

func PopHelpLine

func PopHelpLine()

func PopWindow

func PopWindow()

func PopWindowNoRefresh

func PopWindowNoRefresh()

func PushHelpLine

func PushHelpLine(help string)

func RadioSetCurrent

func RadioSetCurrent(setMember Component)

func RedrawHelpLine

func RedrawHelpLine()

func ReflowText

func ReflowText(text string, width, flexDown, flexUp int) (string, int, int)

func Refresh

func Refresh()

func ResizeScreen

func ResizeScreen(redraw bool)

func Resume

func Resume() int

func ScaleSet

func ScaleSet(c Component, amount uint64)

func ScaleSetColors

func ScaleSetColors(c Component, empty, full int)

func ScrollbarSet

func ScrollbarSet(c Component, where, total int)

func ScrollbarSetColors

func ScrollbarSetColors(c Component, normal, thumb int)

func SetColor

func SetColor(colorSet int, fg, bg string)

func SetColors

func SetColors(colors Colors)

func SetHelpCallback

func SetHelpCallback(cb *Callback)

func SetSuspendCallback

func SetSuspendCallback(cb *SuspendCallback, data *[]byte)

func Suspend

func Suspend()

func TextboxGetNumLines

func TextboxGetNumLines(c Component) int

func TextboxSetColors

func TextboxSetColors(c Component, normal, active int)

func TextboxSetHeight

func TextboxSetHeight(c Component, height int)

func TextboxSetText

func TextboxSetText(c Component, text string)

func WaitForKey

func WaitForKey()

func WinChoice

func WinChoice(title, button1, button2, text string) int

func WinEntries

func WinEntries(title, text string, suggestedWidth, flexDown, flexUp, dataWidth int, items *[]WinEntry, button1 ...string) int

func WinMenu

func WinMenu(title, text string, suggestedWidth, flexDown, flexUp, maxListHeight int, items []string, button1 ...string) (int, int)

func WinMessage

func WinMessage(title, buttonText, text string)

func WinTernary

func WinTernary(title, button1, button2, button3, message string) int

Types

type Callback

type Callback func(*Component, []byte)

type Colors

type Colors struct {
	// contains filtered or unexported fields
}

type Component

type Component struct {
	// contains filtered or unexported fields
}

func Button

func Button(left, top int, text string) Component

func ButtonBar

func ButtonBar(bbar ...*TButtonbar) Component

func Checkbox

func Checkbox(left, top int, text string, defValue, seq string, result *ResultStr) Component

Components

func CheckboxTree

func CheckboxTree(left, top, height, flags int) Component

func CheckboxTreeMulti

func CheckboxTreeMulti(left, top, height int, seq string, flags int) Component

func CompactButton

func CompactButton(left, top int, text string) Component

func CreateGrid

func CreateGrid(cols, rows int) Component

func Entry

func Entry(left, top int, initialValue string, width int, result *ResultStr, flags int) Component

func Form

func Form(vertBar *Component, helpTag string, flags int) Component

func FormGetCurrent

func FormGetCurrent(form Component) Component

func GridBasicWindow

func GridBasicWindow(text, middle, buttons Component) Component

func GridHCloseStacked

func GridHCloseStacked(comps ...Component) Component

func GridHStacked

func GridHStacked(comps ...Component) Component

func GridSimpleWindow

func GridSimpleWindow(text, middle, buttons Component) Component

func GridVCloseStacked

func GridVCloseStacked(comps ...Component) Component

func GridVStacked

func GridVStacked(comps ...Component) Component

func Label

func Label(left, top int, text string) Component

func Listbox

func Listbox(left, top, height, flags int) Component

func RadioGetCurrent

func RadioGetCurrent(setMember Component) Component

func Radiobutton

func Radiobutton(left, top int, text string, isDefault int, prevButton *Component) Component

func RunForm

func RunForm(form Component) Component

func Scale

func Scale(left, top, width int, fullValue int64) Component

func Textbox

func Textbox(left, top, width, height, flags int) Component

func TextboxReflowed

func TextboxReflowed(left, top int, text string, width, flexDown, flexUp, flags int) Component

func VerticalScrollbar

func VerticalScrollbar(left, top, height, normalColorset, thumbColorset int) Component

func (*Component) Equals

func (c *Component) Equals(co *Component) bool

type ExitStruct

type ExitStruct struct {
	// contains filtered or unexported fields
}

func FormRun

func FormRun(form Component) ExitStruct

func (ExitStruct) Component

func (es ExitStruct) Component() Component

func (ExitStruct) Key

func (es ExitStruct) Key() int

func (ExitStruct) Reason

func (es ExitStruct) Reason() int

func (ExitStruct) Watch

func (es ExitStruct) Watch() int

type ResultStr

type ResultStr struct {
	// contains filtered or unexported fields
}

func NewResultStr

func NewResultStr() ResultStr

func (ResultStr) Destroy

func (r ResultStr) Destroy()

func (ResultStr) Set

func (r ResultStr) Set(s string)

func (ResultStr) String

func (r ResultStr) String() string

type SuspendCallback

type SuspendCallback func([]byte)

type TButtonbar

type TButtonbar struct {
	// contains filtered or unexported fields
}

type WinEntry

type WinEntry struct {
	// contains filtered or unexported fields
}

func NewWinEntry

func NewWinEntry(text string, flags int) WinEntry

func NewWinEntryDef

func NewWinEntryDef(text, defaultValue string, flags int) WinEntry

func (WinEntry) Destroy

func (we WinEntry) Destroy()

func (WinEntry) Flags

func (we WinEntry) Flags() int

func (WinEntry) Text

func (we WinEntry) Text() string

func (WinEntry) Value

func (we WinEntry) Value() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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