newt

package module
v0.0.0-...-94734ea Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: MIT Imports: 7 Imported by: 0

README

newt bindings for go

I've decided to share this work, because of go still lacks console dialog library. This code was written for internal use so library is poorly documented and lacks normal godoc comments. Anyway, most methods wrapped directly, so you can use libnewt documentation and read the source.

Maybe I'll add normal godoc later. Feel free to use, extend and fork.

dependencies

libslang, libnewt, go-pointer

Documentation

Index

Constants

View Source
const (
	NEWT_COLORSET_ROOT = iota + 2
	NEWT_COLORSET_BORDER
	NEWT_COLORSET_WINDOW
	NEWT_COLORSET_SHADOW
	NEWT_COLORSET_TITLE
	NEWT_COLORSET_BUTTON
	NEWT_COLORSET_ACTBUTTON
	NEWT_COLORSET_CHECKBOX
	NEWT_COLORSET_ACTCHECKBOX
	NEWT_COLORSET_ENTRY
	NEWT_COLORSET_LABEL
	NEWT_COLORSET_LISTBOX
	NEWT_COLORSET_ACTLISTBOX
	NEWT_COLORSET_TEXTBOX
	NEWT_COLORSET_ACTTEXTBOX
	NEWT_COLORSET_HELPLINE
	NEWT_COLORSET_ROOTTEXT
	NEWT_COLORSET_EMPTYSCALE
	NEWT_COLORSET_FULLSCALE
	NEWT_COLORSET_DISENTRY
	NEWT_COLORSET_COMPACTBUTTON
	NEWT_COLORSET_ACTSELLISTBOX
	NEWT_COLORSET_SELLISTBOX
)
View Source
const (
	NEWT_ARG_LAST   = -100000
	NEWT_ARG_APPEND = -1
)
View Source
const (
	NEWT_FLAG_RETURNEXIT = 1 << iota
	NEWT_FLAG_HIDDEN
	NEWT_FLAG_SCROLL
	NEWT_FLAG_DISABLED

	NEWT_FLAG_BORDER
	NEWT_FLAG_WRAP
	NEWT_FLAG_NOF12
	NEWT_FLAG_MULTIPLE
	NEWT_FLAG_SELECTED
	NEWT_FLAG_CHECKBOX
	NEWT_FLAG_PASSWORD
	NEWT_FLAG_SHOWCURSOR
)
View Source
const (
	NEWT_FD_READ = 1 << iota
	NEWT_FD_WRITE
	NEWT_FD_EXCEPT
)
View Source
const (
	NEWT_CHECKBOXTREE_UNSELECTABLE = iota << 12
	NEWT_CHECKBOXTREE_HIDE_BOX
)
View Source
const (
	NEWT_CHECKBOXTREE_COLLAPSED  = '\000'
	NEWT_CHECKBOXTREE_EXPANDED   = '\001'
	NEWT_CHECKBOXTREE_UNSELECTED = ' '
	NEWT_CHECKBOXTREE_SELECTED   = '*'
)
View Source
const (
	NEWT_LISTBOX_RETURNEXIT = NEWT_FLAG_RETURNEXIT
	NEWT_ENTRY_SCROLL       = NEWT_FLAG_SCROLL
	NEWT_ENTRY_HIDDEN       = NEWT_FLAG_HIDDEN
	NEWT_ENTRY_RETURNEXIT   = NEWT_FLAG_RETURNEXIT
	NEWT_ENTRY_DISABLED     = NEWT_FLAG_DISABLED

	NEWT_TEXTBOX_WRAP   = NEWT_FLAG_WRAP
	NEWT_TEXTBOX_SCROLL = NEWT_FLAG_SCROLL
	NEWT_FORM_NOF12     = NEWT_FLAG_NOF12
)
View Source
const (
	NEWT_KEY_TAB     = '\t'
	NEWT_KEY_ENTER   = '\r'
	NEWT_KEY_SUSPEND = '\032'
	NEWT_KEY_ESCAPE  = '\033'
	NEWT_KEY_RETURN  = NEWT_KEY_ENTER
)
View Source
const (
	NEWT_KEY_EXTRA_BASE = 0x8000 + iota
	NEWT_KEY_UP
	NEWT_KEY_DOWN

	NEWT_KEY_LEFT
	NEWT_KEY_RIGHT
	NEWT_KEY_BKSPC
	NEWT_KEY_DELETE
	NEWT_KEY_HOME
	NEWT_KEY_END
	NEWT_KEY_UNTAB
	NEWT_KEY_PGUP
	NEWT_KEY_PGDN
	NEWT_KEY_INSERT
)
View Source
const (
	NEWT_KEY_F1 = NEWT_KEY_EXTRA_BASE + 101 + iota
	NEWT_KEY_F2
	NEWT_KEY_F3
	NEWT_KEY_F4
	NEWT_KEY_F5
	NEWT_KEY_F6
	NEWT_KEY_F7
	NEWT_KEY_F8
	NEWT_KEY_F9
	NEWT_KEY_F10
	NEWT_KEY_F11
	NEWT_KEY_F12
	NEWT_KEY_RESIZE
	NEWT_KEY_ERROR
)
View Source
const (
	NEWT_ANCHOR_LEFT = 1 << iota
	NEWT_ANCHOR_RIGHT
	NEWT_ANCHOR_TOP
	NEWT_ANCHOR_BOTTOM
)
View Source
const (
	NEWT_GRID_FLAG_GROWX = 1 << iota
	NEWT_GRID_FLAG_GROWY
)
View Source
const (
	NEWT_FLAGS_SET = iota
	NEWT_FLAGS_RESET
	NEWT_FLAGS_TOGGLE
)
View Source
const (
	NEWT_GRID_EMPTY = iota
	NEWT_GRID_COMPONENT
	NEWT_GRID_SUBGRID
)
View Source
const (
	NEWT_EXIT_HOTKEY = iota
	NEWT_EXIT_COMPONENT
	NEWT_EXIT_FDREADY
	NEWT_EXIT_TIMER
	NEWT_EXIT_ERROR
)

Variables

This section is empty.

Functions

func Bell

func Bell()

void newtBell(void);

func CenteredWindow

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

int newtCenteredWindow(unsigned int width,unsigned int height, const char * title);

func CenteredWindowf

func CenteredWindowf(width, height int, format string, args ...interface{}) int

func ClearKeyBuffer

func ClearKeyBuffer()

void newtClearKeyBuffer(void);

func Cls

func Cls()

void newtCls(void);

func CursorOff

func CursorOff()

void newtCursorOff(void);

func CursorOn

func CursorOn()

void newtCursorOn(void);

func Delay

func Delay(d time.Duration)

void newtDelay(unsigned int usecs);

func DrawRootText

func DrawRootText(col, row int, text string)

void newtDrawRootText(int col, int row, const char * text);

func DrawRootTextf

func DrawRootTextf(col, row int, format string, args ...interface{})

func Finished

func Finished() int

int newtFinished(void);

func GetScreenSize

func GetScreenSize() (cols, rows int)

void newtGetScreenSize(int * cols, int * rows);

func Init

func Init() int

int newtInit(void);

func NEWT_COLORSET_CUSTOM

func NEWT_COLORSET_CUSTOM(x int) int

func OpenWindow

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

int newtOpenWindow(int left,int top, unsigned int width,unsigned int height, const char * title);

func OpenWindowf

func OpenWindowf(left, top, width, height int, format string, args ...interface{}) int

func PopHelpLine

func PopHelpLine()

void newtPopHelpLine(void);

func PopWindow

func PopWindow()

void newtPopWindow(void);

func PopWindowNoRefresh

func PopWindowNoRefresh()

void newtPopWindowNoRefresh(void);

func PushHelpLine

func PushHelpLine(text string)

void newtPushHelpLine(const char * text);

func PushHelpLinef

func PushHelpLinef(format string, args ...interface{})

func RedrawHelpLine

func RedrawHelpLine()

void newtRedrawHelpLine(void);

func ReflowText

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

char * newtReflowText(char * text, int width, int flexDown, int flexUp, int * actualWidth, int * actualHeight);

func ReflowTextf

func ReflowTextf(width, flexDown, flexUp int, format string, args ...interface{}) (string, int, int)

func Refresh

func Refresh()

void newtRefresh(void);

func ResizeScreen

func ResizeScreen(redraw bool)

void newtResizeScreen(int redraw);

func Resume

func Resume() int

int newtResume(void);

func SetColor

func SetColor(colorset int, fg, bg string)

void newtSetColor(int colorset, char *fg, char *bg);

func SetHelpCallback

func SetHelpCallback()

void newtSetHelpCallback(newtCallback cb);

func SetSuspendCallback

func SetSuspendCallback(f func())

void newtSetSuspendCallback(newtSuspendCallback cb, void * data);

func Suspend

func Suspend()

void newtSuspend(void);

func WaitForKey

func WaitForKey()

void newtWaitForKey(void);

func WinChoice

func WinChoice(title, button1, button2, format string, args ...interface{}) int

int newtWinChoice(char * title, char * button1, char * button2, char * text, ...);

func WinMenu

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

int newtWinMenu(char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int maxListHeight,

char ** items, int * listItem, char * button1, ...);

func WinMessage

func WinMessage(title, buttonText, format string, args ...interface{})

void newtWinMessage(char * title, char * buttonText, char * text, ...);

func WinTernary

func WinTernary(title, button1, button2, button3, format string, args ...interface{}) int

int newtWinTernary(char * title, char * button1, char * button2, char * button3, char * message, ...);

Types

type Button

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

func NewButton

func NewButton(left, top int, text string) *Button

newtComponent newtButton(int left, int top, const char * text);

func (Button) AddCallback

func (co Button) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Button) AddDestroyCallback

func (co Button) AddDestroyCallback(f func(Component))

func (Button) ComponentDestroy

func (co Button) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Button) ComponentGetSize

func (co Button) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (Button) GetPosition

func (co Button) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (Button) IsA

func (co Button) IsA(c uintptr) bool

func (Button) Ptr

func (co Button) Ptr() uintptr

func (Button) TakesFocus

func (co Button) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Checkbox

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

func NewCheckbox

func NewCheckbox(left, top int, text string, defValue byte, seq string) *Checkbox

newtComponent newtCheckbox(int left, int top, const char * text, char defValue, const char * seq, char * result);

func (Checkbox) AddCallback

func (co Checkbox) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Checkbox) AddDestroyCallback

func (co Checkbox) AddDestroyCallback(f func(Component))

func (Checkbox) ComponentDestroy

func (co Checkbox) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Checkbox) ComponentGetSize

func (co Checkbox) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (Checkbox) GetPosition

func (co Checkbox) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (*Checkbox) GetValue

func (co *Checkbox) GetValue() byte

char newtCheckboxGetValue(newtComponent co);

func (Checkbox) IsA

func (co Checkbox) IsA(c uintptr) bool

func (Checkbox) Ptr

func (co Checkbox) Ptr() uintptr

func (*Checkbox) SetFlags

func (co *Checkbox) SetFlags(flags, sense int)

void newtCheckboxSetFlags(newtComponent co, int flags, enum newtFlagsSense sense);

func (*Checkbox) SetValue

func (co *Checkbox) SetValue(value byte)

void newtCheckboxSetValue(newtComponent co, char value);

func (Checkbox) TakesFocus

func (co Checkbox) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type CheckboxTree

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

func NewCheckboxTree

func NewCheckboxTree(left, top, height, flags int) *CheckboxTree

newtComponent newtCheckboxTree(int left, int top, int height, int flags);

func NewCheckboxTreeMulti

func NewCheckboxTreeMulti(left, top, height int, seq string, flags int) *CheckboxTree

newtComponent newtCheckboxTreeMulti(int left, int top, int height, char *seq, int flags);

func (*CheckboxTree) AddArray

func (co *CheckboxTree) AddArray(text string, key, flags int, path []int) int

int newtCheckboxTreeAddArray(newtComponent co, const char * text, const void * data, int flags, int * indexes);

func (CheckboxTree) AddCallback

func (co CheckboxTree) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (CheckboxTree) AddDestroyCallback

func (co CheckboxTree) AddDestroyCallback(f func(Component))

func (*CheckboxTree) AddItem

func (co *CheckboxTree) AddItem(text string, key, flags int, path ...int) int

int newtCheckboxTreeAddItem(newtComponent co, const char * text, const void * data, int flags, int index, ...);

func (CheckboxTree) ComponentDestroy

func (co CheckboxTree) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (CheckboxTree) ComponentGetSize

func (co CheckboxTree) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*CheckboxTree) FindItem

func (co *CheckboxTree) FindItem(key int) (int, bool)

int * newtCheckboxTreeFindItem(newtComponent co, void * data);

func (*CheckboxTree) GetCurrent

func (co *CheckboxTree) GetCurrent() int

const void * newtCheckboxTreeGetCurrent(newtComponent co);

func (*CheckboxTree) GetEntryValue

func (co *CheckboxTree) GetEntryValue(key int) byte

char newtCheckboxTreeGetEntryValue(newtComponent co, const void * data);

func (*CheckboxTree) GetMultiSelection

func (co *CheckboxTree) GetMultiSelection(seqnum byte) (int, []int)

const void ** newtCheckboxTreeGetMultiSelection(newtComponent co, int *numitems, char seqnum);

func (CheckboxTree) GetPosition

func (co CheckboxTree) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (*CheckboxTree) GetSelection

func (co *CheckboxTree) GetSelection() (int, []int)

const void ** newtCheckboxTreeGetSelection(newtComponent co, int *numitems);

func (CheckboxTree) IsA

func (co CheckboxTree) IsA(c uintptr) bool

func (CheckboxTree) Ptr

func (co CheckboxTree) Ptr() uintptr

func (*CheckboxTree) SetCurrent

func (co *CheckboxTree) SetCurrent(item int)

void newtCheckboxTreeSetCurrent(newtComponent co, void * item);

func (*CheckboxTree) SetEntry

func (co *CheckboxTree) SetEntry(key int, text string)

void newtCheckboxTreeSetEntry(newtComponent co, const void * data, const char * text);

func (*CheckboxTree) SetEntryValue

func (co *CheckboxTree) SetEntryValue(key int, value byte)

void newtCheckboxTreeSetEntryValue(newtComponent co, const void * data, char value);

func (*CheckboxTree) SetEntryf

func (co *CheckboxTree) SetEntryf(num int, format string, args ...interface{})

func (*CheckboxTree) SetWidth

func (co *CheckboxTree) SetWidth(width int)

void newtCheckboxTreeSetWidth(newtComponent co, int width);

func (CheckboxTree) TakesFocus

func (co CheckboxTree) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type CompactButton

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

func NewCompactButton

func NewCompactButton(left, top int, text string) *CompactButton

newtComponent newtCompactButton(int left, int top, const char * text);

func (CompactButton) AddCallback

func (co CompactButton) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (CompactButton) AddDestroyCallback

func (co CompactButton) AddDestroyCallback(f func(Component))

func (CompactButton) ComponentDestroy

func (co CompactButton) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (CompactButton) ComponentGetSize

func (co CompactButton) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (CompactButton) GetPosition

func (co CompactButton) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (CompactButton) IsA

func (co CompactButton) IsA(c uintptr) bool

func (CompactButton) Ptr

func (co CompactButton) Ptr() uintptr

func (CompactButton) TakesFocus

func (co CompactButton) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Component

type Component interface {
	Ptr() uintptr
	IsA(uintptr) bool
	// contains filtered or unexported methods
}

type Entry

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

func NewEntry

func NewEntry(left, top int, initialValue string, width, flags int) *Entry

newtComponent newtEntry(int left, int top, const char * initialValue, int width, const char ** resultPtr, int flags);

func (Entry) AddCallback

func (co Entry) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Entry) AddDestroyCallback

func (co Entry) AddDestroyCallback(f func(Component))

func (Entry) ComponentDestroy

func (co Entry) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Entry) ComponentGetSize

func (co Entry) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*Entry) GetCursorPosition

func (co *Entry) GetCursorPosition() int

int newtEntryGetCursorPosition(newtComponent co);

func (Entry) GetPosition

func (co Entry) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (*Entry) GetValue

func (co *Entry) GetValue() string

char * newtEntryGetValue(newtComponent co);

func (Entry) IsA

func (co Entry) IsA(c uintptr) bool

func (Entry) Ptr

func (co Entry) Ptr() uintptr

func (*Entry) Set

func (co *Entry) Set(value string, cursorAtEnd bool)

void newtEntrySet(newtComponent co, const char * value, int cursorAtEnd);

func (*Entry) SetColors

func (co *Entry) SetColors(normal, disabled int)

void newtEntrySetColors(newtComponent co, int normal, int disabled);

func (*Entry) SetCursorPosition

func (co *Entry) SetCursorPosition(position int)

void newtEntrySetCursorPosition(newtComponent co, int position);

func (*Entry) SetFilter

func (co *Entry) SetFilter(f func(*Entry, rune, int) rune)

void newtEntrySetFilter(newtComponent co, newtEntryFilter filter, void * data);

func (*Entry) SetFlags

func (co *Entry) SetFlags(flags, sense int)

void newtEntrySetFlags(newtComponent co, int flags, enum newtFlagsSense sense);

func (*Entry) SetText

func (co *Entry) SetText(value string)

func (*Entry) SetTextf

func (co *Entry) SetTextf(format string, args ...interface{})

func (*Entry) Setf

func (co *Entry) Setf(cursorAtEnd bool, format string, args ...interface{})

func (Entry) TakesFocus

func (co Entry) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Form

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

func NewForm

func NewForm(vertBar *VerticalScrollbar, help func(Component), flags int) *Form

newtComponent newtForm(newtComponent vertBar, void * helpTag, int flags);

func (Form) AddCallback

func (co Form) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (*Form) AddComponent

func (co *Form) AddComponent(component Component)

void newtFormAddComponent(newtComponent form, newtComponent co);

func (*Form) AddComponents

func (co *Form) AddComponents(cos ...Component)

void newtFormAddComponents(newtComponent form, ...);

func (Form) AddDestroyCallback

func (co Form) AddDestroyCallback(f func(Component))

func (*Form) AddHotKey

func (co *Form) AddHotKey(key int)

void newtFormAddHotKey(newtComponent co, int key);

func (Form) ComponentDestroy

func (co Form) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Form) ComponentGetSize

func (co Form) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*Form) Destroy

func (co *Form) Destroy()

void newtFormDestroy(newtComponent form);

func (*Form) Draw

func (co *Form) Draw()

void newtDrawForm(newtComponent form);

func (*Form) GetCurrent

func (co *Form) GetCurrent() uintptr

newtComponent newtFormGetCurrent(newtComponent co);

func (Form) GetPosition

func (co Form) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (*Form) GetScrollPosition

func (co *Form) GetScrollPosition() int

int newtFormGetScrollPosition(newtComponent co);

func (Form) IsA

func (co Form) IsA(c uintptr) bool

func (Form) Ptr

func (co Form) Ptr() uintptr

func (*Form) Run

func (co *Form) Run() (int, int, uintptr)

void newtFormRun(newtComponent co, struct newtExitStruct * es);

func (*Form) RunComponent

func (co *Form) RunComponent() uintptr

newtComponent newtRunForm(newtComponent form);

func (*Form) SetBackground

func (co *Form) SetBackground(color int)

void newtFormSetBackground(newtComponent co, int color);

func (*Form) SetCurrent

func (co *Form) SetCurrent(subco *Form)

void newtFormSetCurrent(newtComponent co, newtComponent subco);

func (*Form) SetHeight

func (co *Form) SetHeight(height int)

void newtFormSetHeight(newtComponent co, int height);

func (*Form) SetScrollPosition

func (co *Form) SetScrollPosition(position int)

void newtFormSetScrollPosition(newtComponent co, int position);

func (*Form) SetSize

func (co *Form) SetSize()

void newtFormSetSize(newtComponent co);

func (*Form) SetTimer

func (co *Form) SetTimer(d time.Duration)

void newtFormSetTimer(newtComponent form, int millisecs);

func (*Form) SetWidth

func (co *Form) SetWidth(width int)

void newtFormSetWidth(newtComponent co, int width);

func (Form) TakesFocus

func (co Form) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

func (*Form) WatchFd

func (co *Form) WatchFd(fd uintptr, fdFlags int)

void newtFormWatchFd(newtComponent form, int fd, int fdFlags);

type Gauge

type Gauge struct {
	*Textbox
	*Scale
	*Form
	// contains filtered or unexported fields
}

func NewGauge

func NewGauge(width, lines int, fullValue int64, title string, args ...interface{}) *Gauge

func (*Gauge) Inc

func (g *Gauge) Inc(amount uint64) uint64

func (*Gauge) Update

func (g *Gauge) Update(amount uint64, text string, args ...interface{})

type GaugeReader

type GaugeReader struct {
	*Gauge
	io.Reader
}

func NewGaugeReader

func NewGaugeReader(g *Gauge, r io.Reader) *GaugeReader

func (*GaugeReader) Read

func (g *GaugeReader) Read(p []byte) (int, error)

type Grid

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

func NewButtonBar

func NewButtonBar(buttons ...*Button) *Grid

newtGrid newtButtonBar(char * button1, newtComponent * b1comp, ...);

func NewGrid

func NewGrid(cols, rows int) *Grid

newtGrid newtCreateGrid(int cols, int rows);

func NewGridBasicWindow

func NewGridBasicWindow(text Component, middle, buttons *Grid) *Grid

newtGrid newtGridBasicWindow(newtComponent text, newtGrid middle, newtGrid buttons);

func NewGridHCloseStacked

func NewGridHCloseStacked(what ...GridElement) *Grid

newtGrid newtGridHCloseStacked(enum newtGridElement type1, void * what1, ...);

func NewGridHStacked

func NewGridHStacked(what ...GridElement) *Grid

newtGrid newtGridHStacked(enum newtGridElement type1, void * what1, ...);

func NewGridSimpleWindow

func NewGridSimpleWindow(text Component, middle Component, buttons *Grid) *Grid

newtGrid newtGridSimpleWindow(newtComponent text, newtComponent middle, newtGrid buttons);

func NewGridVCloseStacked

func NewGridVCloseStacked(what ...GridElement) *Grid

newtGrid newtGridVCloseStacked(enum newtGridElement type, void * what, ...);

func NewGridVStacked

func NewGridVStacked(what ...GridElement) *Grid

newtGrid newtGridVStacked(enum newtGridElement type, void * what, ...);

func Stackem

func Stackem(isClose, isVertical bool, what ...GridElement) *Grid

static newtGrid stackem(int isVert, enum newtGridElement type1, void * what1,

va_list args, int close) {

func (*Grid) AddComponentsToForm

func (g *Grid) AddComponentsToForm(form *Form, recurse bool)

void newtGridAddComponentsToForm(newtGrid grid, newtComponent form, int recurse);

func (*Grid) Free

func (g *Grid) Free(recursive bool)

void newtGridFree(newtGrid grid, int recurse);

func (*Grid) GetSize

func (g *Grid) GetSize() (int, int)

void newtGridGetSize(newtGrid grid, int * width, int * height);

func (*Grid) Place

func (g *Grid) Place(left, top int)

void newtGridPlace(newtGrid grid, int left, int top);

func (*Grid) SetField

func (g *Grid) SetField(col, row int, cg GridElement, padLeft, padTop, padRight, padBottom, anchor, flags int)

void newtGridSetField(newtGrid grid, int col, int row, enum newtGridElement type, void * val, int padLeft,

int padTop, int padRight, int padBottom, int anchor, int flags);

func (*Grid) WrappedWindow

func (g *Grid) WrappedWindow(title string)

void newtGridWrappedWindow(newtGrid grid, char * title);

func (*Grid) WrappedWindowAt

func (g *Grid) WrappedWindowAt(title string, left, top int)

void newtGridWrappedWindowAt(newtGrid grid, char * title, int left, int top);

type GridElement

type GridElement interface {
	// contains filtered or unexported methods
}

type Label

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

func NewLabel

func NewLabel(left, top int, text string) *Label

newtComponent newtLabel(int left, int top, const char * text);

func (Label) AddCallback

func (co Label) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Label) AddDestroyCallback

func (co Label) AddDestroyCallback(f func(Component))

func (Label) ComponentDestroy

func (co Label) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Label) ComponentGetSize

func (co Label) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (Label) GetPosition

func (co Label) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (Label) IsA

func (co Label) IsA(c uintptr) bool

func (Label) Ptr

func (co Label) Ptr() uintptr

func (*Label) SetColors

func (co *Label) SetColors(colorset int)

void newtLabelSetColors(newtComponent co, int colorset);

func (*Label) SetText

func (co *Label) SetText(text string)

void newtLabelSetText(newtComponent co, const char * text);

func (*Label) SetTextf

func (co *Label) SetTextf(format string, args ...interface{})

func (Label) TakesFocus

func (co Label) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Listbox

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

func NewListbox

func NewListbox(left, top, height, flags int) *Listbox

newtComponent newtListbox(int left, int top, int height, int flags);

func (Listbox) AddCallback

func (co Listbox) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Listbox) AddDestroyCallback

func (co Listbox) AddDestroyCallback(f func(Component))

func (*Listbox) AppendEntry

func (co *Listbox) AppendEntry(text string, key int) int

int newtListboxAppendEntry(newtComponent co, const char * text, const void * data);

func (*Listbox) Clear

func (co *Listbox) Clear()

void newtListboxClear(newtComponent co);

func (*Listbox) ClearSelection

func (co *Listbox) ClearSelection()

void newtListboxClearSelection(newtComponent co);

func (Listbox) ComponentDestroy

func (co Listbox) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Listbox) ComponentGetSize

func (co Listbox) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*Listbox) DeleteEntry

func (co *Listbox) DeleteEntry(key int) int

int newtListboxDeleteEntry(newtComponent co, void * data);

func (*Listbox) GetCurrent

func (co *Listbox) GetCurrent() int

void * newtListboxGetCurrent(newtComponent co);

func (*Listbox) GetEntry

func (co *Listbox) GetEntry(num int) ([]string, []int)

void newtListboxGetEntry(newtComponent co, int num, char **text, void **data);

func (Listbox) GetPosition

func (co Listbox) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (*Listbox) GetSelection

func (co *Listbox) GetSelection() (int, []int)

void **newtListboxGetSelection(newtComponent co, int *numitems);

func (*Listbox) InsertEntry

func (co *Listbox) InsertEntry(text string, key2, key1 int) int

int newtListboxInsertEntry(newtComponent co, const char * text, const void * data, void * key);

func (Listbox) IsA

func (co Listbox) IsA(c uintptr) bool

func (*Listbox) ItemCount

func (co *Listbox) ItemCount() int

int newtListboxItemCount(newtComponent co);

func (Listbox) Ptr

func (co Listbox) Ptr() uintptr

func (*Listbox) SelectItem

func (co *Listbox) SelectItem(key int, sense int)

void newtListboxSelectItem(newtComponent co, const void * key, enum newtFlagsSense sense);

func (*Listbox) SetCurrent

func (co *Listbox) SetCurrent(num int)

void newtListboxSetCurrent(newtComponent co, int num);

func (*Listbox) SetCurrentByKey

func (co *Listbox) SetCurrentByKey(key int)

void newtListboxSetCurrentByKey(newtComponent co, void * key);

func (*Listbox) SetData

func (co *Listbox) SetData(num int, key int)

void newtListboxSetData(newtComponent co, int num, void * data);

func (*Listbox) SetEntry

func (co *Listbox) SetEntry(num int, text string)

void newtListboxSetEntry(newtComponent co, int num, const char * text);

func (*Listbox) SetEntryf

func (co *Listbox) SetEntryf(num int, format string, args ...interface{})

func (*Listbox) SetWidth

func (co *Listbox) SetWidth(width int)

void newtListboxSetWidth(newtComponent co, int width);

func (Listbox) TakesFocus

func (co Listbox) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Radiobutton

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

func NewRadiobutton

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

newtComponent newtRadiobutton(int left, int top, const char * text, int isDefault, newtComponent prevButton);

func (Radiobutton) AddCallback

func (co Radiobutton) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Radiobutton) AddDestroyCallback

func (co Radiobutton) AddDestroyCallback(f func(Component))

func (Radiobutton) ComponentDestroy

func (co Radiobutton) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Radiobutton) ComponentGetSize

func (co Radiobutton) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*Radiobutton) GetCurrent

func (co *Radiobutton) GetCurrent() uintptr

newtComponent newtRadioGetCurrent(newtComponent setMember);

func (Radiobutton) GetPosition

func (co Radiobutton) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (Radiobutton) IsA

func (co Radiobutton) IsA(c uintptr) bool

func (Radiobutton) Ptr

func (co Radiobutton) Ptr() uintptr

func (*Radiobutton) SetCurrent

func (co *Radiobutton) SetCurrent()

void newtRadioSetCurrent(newtComponent setMember);

func (Radiobutton) TakesFocus

func (co Radiobutton) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Scale

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

func NewScale

func NewScale(left, top, width int, fullValue int64) *Scale

newtComponent newtScale(int left, int top, int width, long long fullValue);

func (Scale) AddCallback

func (co Scale) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Scale) AddDestroyCallback

func (co Scale) AddDestroyCallback(f func(Component))

func (Scale) ComponentDestroy

func (co Scale) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Scale) ComponentGetSize

func (co Scale) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (Scale) GetPosition

func (co Scale) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (Scale) IsA

func (co Scale) IsA(c uintptr) bool

func (Scale) Ptr

func (co Scale) Ptr() uintptr

func (*Scale) Set

func (co *Scale) Set(amount uint64)

void newtScaleSet(newtComponent co, unsigned long long amount);

func (*Scale) SetColors

func (co *Scale) SetColors(empty, full int)

void newtScaleSetColors(newtComponent co, int empty, int full);

func (Scale) TakesFocus

func (co Scale) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type Textbox

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

func NewTextbox

func NewTextbox(left, top, width, height, flags int) *Textbox

newtComponent newtTextbox(int left, int top, int width, int height, int flags);

func NewTextboxReflowed

func NewTextboxReflowed(left, top int, text string, width, flexDown, flexUp, flags int) *Textbox

newtComponent newtTextboxReflowed(int left, int top, char * text, int width, int flexDown, int flexUp, int flags);

func NewTextboxReflowedf

func NewTextboxReflowedf(left, top, width, flexDown, flexUp, flags int, format string, args ...interface{}) *Textbox

func (Textbox) AddCallback

func (co Textbox) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (Textbox) AddDestroyCallback

func (co Textbox) AddDestroyCallback(f func(Component))

func (Textbox) ComponentDestroy

func (co Textbox) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (Textbox) ComponentGetSize

func (co Textbox) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (*Textbox) GetNumLines

func (co *Textbox) GetNumLines() int

int newtTextboxGetNumLines(newtComponent co);

func (Textbox) GetPosition

func (co Textbox) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (Textbox) IsA

func (co Textbox) IsA(c uintptr) bool

func (Textbox) Ptr

func (co Textbox) Ptr() uintptr

func (*Textbox) SetColors

func (co *Textbox) SetColors(normal, active int)

void newtTextboxSetColors(newtComponent co, int normal, int active);

func (*Textbox) SetHeight

func (co *Textbox) SetHeight(height int)

void newtTextboxSetHeight(newtComponent co, int height);

func (*Textbox) SetText

func (co *Textbox) SetText(text string)

void newtTextboxSetText(newtComponent co, const char * text);

func (*Textbox) SetTextf

func (co *Textbox) SetTextf(format string, args ...interface{})

func (Textbox) TakesFocus

func (co Textbox) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

type VerticalScrollbar

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

func NewVerticalScrollbar

func NewVerticalScrollbar(left, top, height, normalColorset, thumbColorset int) *VerticalScrollbar

newtComponent newtVerticalScrollbar(int left, int top, int height, int normalColorset, int thumbColorset);

func (VerticalScrollbar) AddCallback

func (co VerticalScrollbar) AddCallback(f func(Component))

void newtComponentAddCallback(newtComponent co, newtCallback f, void * data);

func (VerticalScrollbar) AddDestroyCallback

func (co VerticalScrollbar) AddDestroyCallback(f func(Component))

func (VerticalScrollbar) ComponentDestroy

func (co VerticalScrollbar) ComponentDestroy()

void newtComponentDestroy(newtComponent co);

func (VerticalScrollbar) ComponentGetSize

func (co VerticalScrollbar) ComponentGetSize() (int, int)

void newtComponentGetSize(newtComponent co, int * width, int * height);

func (VerticalScrollbar) GetPosition

func (co VerticalScrollbar) GetPosition() (int, int)

void newtComponentGetPosition(newtComponent co, int * left, int * top);

func (VerticalScrollbar) IsA

func (co VerticalScrollbar) IsA(c uintptr) bool

func (VerticalScrollbar) Ptr

func (co VerticalScrollbar) Ptr() uintptr

func (*VerticalScrollbar) Set

func (co *VerticalScrollbar) Set(where, total int)

void newtScrollbarSet(newtComponent co, int where, int total);

func (*VerticalScrollbar) SetColors

func (co *VerticalScrollbar) SetColors(normal, thumb int)

void newtScrollbarSetColors(newtComponent co, int normal, int thumb);

func (VerticalScrollbar) TakesFocus

func (co VerticalScrollbar) TakesFocus(val bool)

void newtComponentTakesFocus(newtComponent co, int val);

Jump to

Keyboard shortcuts

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