Documentation ¶
Overview ¶
The newt package implements bindings to Erik Troan's newt library.
Index ¶
- Constants
- func Bell()
- func CenteredWindow(width, height uint, title string) int
- func CheckboxGetValue(c Component) int
- func CheckboxSetFlags(c Component, flags int, sense uint32)
- func CheckboxSetValue(c Component, value int)
- func CheckboxTreeAddArray(c Component, text string, data uintptr, flags int, indexes []int) int
- func CheckboxTreeAddItem(c Component, text string, data uintptr, flags int, index int) int
- func CheckboxTreeFindItem(c Component, data uintptr) int
- func CheckboxTreeGetCurrent(c Component) uintptr
- func CheckboxTreeGetEntryValue(c Component) (int, uintptr)
- func CheckboxTreeGetMultiSelection(c Component, seqnum int) (int, *uintptr)
- func CheckboxTreeGetSelection(c Component) (int, *uintptr)
- func CheckboxTreeSetCurrent(c Component, item uintptr)
- func CheckboxTreeSetEntry(c Component, data uintptr, text string)
- func CheckboxTreeSetEntryValue(c Component, data uintptr, value int)
- func CheckboxTreeSetWidth(c Component, width int)
- func ClearKeyBuffer()
- func Cls()
- func ComponentAddCallback(c Component, f Callback, data []byte)
- func ComponentAddDestroyCallback(c Component, f Callback, data []byte)
- func ComponentDestroy(c Component)
- func ComponentGetPosition(c Component) (int, int)
- func ComponentGetSize(c Component) (int, int)
- func ComponentTakesFocus(c Component, val int)
- func CursorOff()
- func CursorOn()
- func Delay(usecs uint)
- func DrawForm(form Component)
- func DrawRootText(col, row int, text string)
- func EntryGetCursorPosition(c Component) int
- func EntryGetValue(c Component) string
- func EntrySet(c Component, value string, cursorAtEnd int)
- func EntrySetColors(c Component, normal, disabled int)
- func EntrySetCursorPosition(c Component, position int)
- func EntrySetFilter(c Component, filter uintptr, data []byte)
- func EntrySetFlags(c Component, flags int, sense uint32)
- func Finished() int
- func FormAddComponent(form, c Component)
- func FormAddComponents(form Component, args ...Component)
- func FormAddHotKey(c Component, key int)
- func FormDestroy(c Component)
- func FormGetScrollPosition(c Component) int
- func FormSetBackground(c Component, color int)
- func FormSetCurrent(form, c Component)
- func FormSetHeight(c Component, height int)
- func FormSetScrollPosition(c Component, position int)
- func FormSetSize(c Component)
- func FormSetTimer(form Component, millisecs int)
- func FormSetWidth(c Component, width int)
- func FormWatchFd(form Component, fd, fdFlags int)
- func GetScreenSize() (int, int)
- func GridAddComponentsToForm(grid, form Component, recurse int)
- func GridDestroy(c Component, recurse int)
- func GridFree(c Component, recurse int)
- func GridGetSize(c Component) (int, int)
- func GridPlace(c Component, left, top int)
- func GridSetField(c Component, col, row int, typ uint32, val Component, ...)
- func GridWrappedWindow(c Component, title string)
- func GridWrappedWindowAt(c Component, title string, left, top int)
- func Init() int
- func LabelSetColors(c Component, colorset int)
- func LabelSetText(c Component, text string)
- func ListboxAddEntry(c Component, text string, data uintptr) int
- func ListboxAppendEntry(c Component, text string, data uintptr) int
- func ListboxClear(c Component)
- func ListboxClearSelection(c Component)
- func ListboxDeleteEntry(c Component, data uintptr) int
- func ListboxGetCurrent(c Component) uintptr
- func ListboxGetEntry(c Component, num int) (string, uintptr)
- func ListboxGetSelection(c Component) (int, []uintptr)
- func ListboxInsertEntry(c Component, text string, data, key uintptr) int
- func ListboxItemCount(c Component) int
- func ListboxSelectItem(c Component, key uintptr, sense uint32)
- func ListboxSetCurrent(c Component, num int)
- func ListboxSetCurrentByKey(c Component, key uintptr)
- func ListboxSetData(c Component, num int, data uintptr)
- func ListboxSetEntry(c Component, num int, text string)
- func ListboxSetWidth(c Component, width int)
- func OpenWindow(left, top int, width, height uint, title string) int
- func PopHelpLine()
- func PopWindow()
- func PopWindowNoRefresh()
- func PushHelpLine(help string)
- func RadioSetCurrent(setMember Component)
- func RedrawHelpLine()
- func ReflowText(text string, width, flexDown, flexUp int) (string, int, int)
- func Refresh()
- func ResizeScreen(redraw bool)
- func Resume() int
- func ScaleSet(c Component, amount uint64)
- func ScaleSetColors(c Component, empty, full int)
- func ScrollbarSet(c Component, where, total int)
- func ScrollbarSetColors(c Component, normal, thumb int)
- func SetColor(colorSet int, fg, bg string)
- func SetColors(colors Colors)
- func SetHelpCallback(cb *Callback)
- func SetSuspendCallback(cb *SuspendCallback, data *[]byte)
- func Suspend()
- func TextboxGetNumLines(c Component) int
- func TextboxSetColors(c Component, normal, active int)
- func TextboxSetHeight(c Component, height int)
- func TextboxSetText(c Component, text string)
- func WaitForKey()
- func WinChoice(title, button1, button2, text string) int
- func WinEntries(title, text string, suggestedWidth, flexDown, flexUp, dataWidth int, ...) int
- func WinMenu(title, text string, suggestedWidth, flexDown, flexUp, maxListHeight int, ...) (int, int)
- func WinMessage(title, buttonText, text string)
- func WinTernary(title, button1, button2, button3, message string) int
- type Callback
- type Colors
- type Component
- func Button(left, top int, text string) Component
- func ButtonBar(bbar ...*TButtonbar) Component
- func Checkbox(left, top int, text string, defValue, seq string, result *ResultStr) Component
- func CheckboxTree(left, top, height, flags int) Component
- func CheckboxTreeMulti(left, top, height int, seq string, flags int) Component
- func CompactButton(left, top int, text string) Component
- func CreateGrid(cols, rows int) Component
- func Entry(left, top int, initialValue string, width int, result *ResultStr, flags int) Component
- func Form(vertBar *Component, helpTag string, flags int) Component
- func FormGetCurrent(form Component) Component
- func GridBasicWindow(text, middle, buttons Component) Component
- func GridHCloseStacked(comps ...Component) Component
- func GridHStacked(comps ...Component) Component
- func GridSimpleWindow(text, middle, buttons Component) Component
- func GridVCloseStacked(comps ...Component) Component
- func GridVStacked(comps ...Component) Component
- func Label(left, top int, text string) Component
- func Listbox(left, top, height, flags int) Component
- func RadioGetCurrent(setMember Component) Component
- func Radiobutton(left, top int, text string, isDefault int, prevButton *Component) Component
- func RunForm(form Component) Component
- func Scale(left, top, width int, fullValue int64) Component
- func Textbox(left, top, width, height, flags int) Component
- func TextboxReflowed(left, top int, text string, width, flexDown, flexUp, flags int) Component
- func VerticalScrollbar(left, top, height, normalColorset, thumbColorset int) Component
- type ExitStruct
- type ResultStr
- type SuspendCallback
- type TButtonbar
- type WinEntry
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 CenteredWindow ¶
func CheckboxGetValue ¶
func CheckboxSetFlags ¶
func CheckboxSetValue ¶
func CheckboxTreeAddArray ¶
func CheckboxTreeAddItem ¶
func CheckboxTreeFindItem ¶
func CheckboxTreeGetCurrent ¶
func CheckboxTreeSetCurrent ¶
func CheckboxTreeSetEntry ¶
func CheckboxTreeSetWidth ¶
func ClearKeyBuffer ¶
func ClearKeyBuffer()
func ComponentAddCallback ¶
func ComponentDestroy ¶
func ComponentDestroy(c Component)
func ComponentGetPosition ¶
func ComponentGetSize ¶
func ComponentTakesFocus ¶
func DrawRootText ¶
func EntryGetCursorPosition ¶
func EntryGetValue ¶
func EntrySetColors ¶
func EntrySetCursorPosition ¶
func EntrySetFilter ¶
func EntrySetFlags ¶
func FormAddComponent ¶
func FormAddComponent(form, c Component)
func FormAddComponents ¶
func FormAddHotKey ¶
func FormDestroy ¶
func FormDestroy(c Component)
func FormGetScrollPosition ¶
func FormSetBackground ¶
func FormSetCurrent ¶
func FormSetCurrent(form, c Component)
func FormSetHeight ¶
func FormSetScrollPosition ¶
func FormSetSize ¶
func FormSetSize(c Component)
func FormSetTimer ¶
func FormSetWidth ¶
func FormWatchFd ¶
func GridAddComponentsToForm ¶
func GridDestroy ¶
func GridGetSize ¶
func GridSetField ¶
func GridWrappedWindow ¶
func GridWrappedWindowAt ¶
func LabelSetColors ¶
func LabelSetText ¶
func ListboxClear ¶
func ListboxClear(c Component)
func ListboxClearSelection ¶
func ListboxClearSelection(c Component)
func ListboxDeleteEntry ¶
func ListboxGetCurrent ¶
func ListboxGetSelection ¶
func ListboxItemCount ¶
func ListboxSelectItem ¶
func ListboxSetCurrent ¶
func ListboxSetCurrentByKey ¶
func ListboxSetData ¶
func ListboxSetEntry ¶
func ListboxSetWidth ¶
func PopHelpLine ¶
func PopHelpLine()
func PopWindowNoRefresh ¶
func PopWindowNoRefresh()
func PushHelpLine ¶
func PushHelpLine(help string)
func RadioSetCurrent ¶
func RadioSetCurrent(setMember Component)
func RedrawHelpLine ¶
func RedrawHelpLine()
func ResizeScreen ¶
func ResizeScreen(redraw bool)
func ScaleSetColors ¶
func ScrollbarSet ¶
func ScrollbarSetColors ¶
func SetHelpCallback ¶
func SetHelpCallback(cb *Callback)
func SetSuspendCallback ¶
func SetSuspendCallback(cb *SuspendCallback, data *[]byte)
func TextboxGetNumLines ¶
func TextboxSetColors ¶
func TextboxSetHeight ¶
func TextboxSetText ¶
func WaitForKey ¶
func WaitForKey()
func WinEntries ¶
func WinMessage ¶
func WinMessage(title, buttonText, text string)
func WinTernary ¶
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func ButtonBar ¶
func ButtonBar(bbar ...*TButtonbar) Component
func CheckboxTree ¶
func CheckboxTreeMulti ¶
func CompactButton ¶
func CreateGrid ¶
func FormGetCurrent ¶
func GridBasicWindow ¶
func GridHCloseStacked ¶
func GridHStacked ¶
func GridSimpleWindow ¶
func GridVCloseStacked ¶
func GridVStacked ¶
func RadioGetCurrent ¶
func Radiobutton ¶
func TextboxReflowed ¶
func VerticalScrollbar ¶
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
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 NewWinEntryDef ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.