Documentation ¶
Index ¶
- func ClipboardClear()
- func ClipboardGet() string
- func ClipboardSet(s string)
- func Close()
- func CreateLog(filename string)
- func Flush()
- func Init() error
- func Logf(format string, args ...interface{})
- func Logln(s string)
- func Poll() error
- func SetFocus(w Window)
- func Size() (x, y int)
- type EditBox
- func (b *EditBox) Contents() string
- func (b *EditBox) CopyToClipboard()
- func (b *EditBox) Cursor() (x, y int)
- func (b *EditBox) CursorDown()
- func (b *EditBox) CursorEndOfBuffer()
- func (b *EditBox) CursorEndOfLine()
- func (b *EditBox) CursorLeft()
- func (b *EditBox) CursorPageDown()
- func (b *EditBox) CursorPageUp()
- func (b *EditBox) CursorRight()
- func (b *EditBox) CursorSet(x, y int)
- func (b *EditBox) CursorStartOfBuffer()
- func (b *EditBox) CursorStartOfLine()
- func (b *EditBox) CursorUp()
- func (b *EditBox) CursorWordEnd()
- func (b *EditBox) CursorWordStart()
- func (b *EditBox) CutToClipboard()
- func (b *EditBox) DeleteChar()
- func (b *EditBox) DeleteCharLeft()
- func (b *EditBox) DeleteChars(n int)
- func (b *EditBox) DeleteRow()
- func (b *EditBox) Draw()
- func (b *EditBox) InsertChar(ch rune)
- func (b *EditBox) InsertRow()
- func (b *EditBox) InsertString(s string)
- func (b *EditBox) LastRow() int
- func (b *EditBox) PasteFromClipboard()
- func (b *EditBox) Selection() string
- func (b *EditBox) SetView(x, y int)
- func (b *EditBox) Size() (width, height int)
- func (b *EditBox) View() (x, y int)
- func (b *EditBox) Write(p []byte) (n int, err error)
- type EditBoxFlags
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClipboardClear ¶
func ClipboardClear()
ClipboardClear clears the current contents of the clipboard.
func ClipboardGet ¶
func ClipboardGet() string
ClipboardGet returns the current contents of the clipboard
func Logf ¶
func Logf(format string, args ...interface{})
Logf logs a formatted line of text to the log output file.
Types ¶
type EditBox ¶
type EditBox struct {
// contains filtered or unexported fields
}
An EditBox represents a editable area of text on the screen. Many common text editing controls are allowed within an EditBox: cursor movement, character insertion and deleteion, text selection, copy/cut/paste, etc.
func NewEditBox ¶
func NewEditBox(x, y, width, height int, flags EditBoxFlags) *EditBox
NewEditBox creates a new EditBox control with the specified screen position and size.
func (*EditBox) Contents ¶
func (b *EditBox) Contents() string
Contents returns the entire contents of the edit buffer.
func (*EditBox) CopyToClipboard ¶
func (b *EditBox) CopyToClipboard()
CopyToClipboard copies the current selection to the clipboard.
func (*EditBox) Cursor ¶
func (b *EditBox) Cursor() (x, y int)
Cursor returns the cursor's current column and row within the edit buffer.
func (*EditBox) CursorDown ¶
func (b *EditBox) CursorDown()
CursorDown moves the cursor down a line.
func (*EditBox) CursorEndOfBuffer ¶
func (b *EditBox) CursorEndOfBuffer()
CursorEndOfBuffer moves the cursor to the end of the edit buffer.
func (*EditBox) CursorEndOfLine ¶
func (b *EditBox) CursorEndOfLine()
CursorEndOfLine moves the cursor to the end of the current line.
func (*EditBox) CursorLeft ¶
func (b *EditBox) CursorLeft()
CursorLeft moves the cursor left, shifting to the end of the previous line if the cursor is at column 0.
func (*EditBox) CursorPageDown ¶
func (b *EditBox) CursorPageDown()
CursorPageDown moves the cursor down a page.
func (*EditBox) CursorPageUp ¶
func (b *EditBox) CursorPageUp()
CursorPageUp moves the cursor up a page.
func (*EditBox) CursorRight ¶
func (b *EditBox) CursorRight()
CursorRight moves the cursor right, shifting to the next line if the cursor is at the right-most column of the current line.
func (*EditBox) CursorSet ¶
func (b *EditBox) CursorSet(x, y int)
CursorSet sets the position of the cursor within the edit buffer. Negative values position the cursor relative to the last column and row of the buffer. A value of -1 for x indicates the end of the row. A value of -1 for y indicates the last row.
func (*EditBox) CursorStartOfBuffer ¶
func (b *EditBox) CursorStartOfBuffer()
CursorStartOfBuffer moves the cursor to the start of the edit buffer.
func (*EditBox) CursorStartOfLine ¶
func (b *EditBox) CursorStartOfLine()
CursorStartOfLine moves the cursor to the start of the current line.
func (*EditBox) CursorWordEnd ¶
func (b *EditBox) CursorWordEnd()
CursorWordEnd moves the cursor to end of the word.
func (*EditBox) CursorWordStart ¶
func (b *EditBox) CursorWordStart()
CursorWordStart moves the cursor to the start of the word.
func (*EditBox) CutToClipboard ¶
func (b *EditBox) CutToClipboard()
CutToClipboard copies the current selection to the clipboard and then deletes it from the edit buffer.
func (*EditBox) DeleteChar ¶
func (b *EditBox) DeleteChar()
DeleteChar deletes a single character at the current cursor position.
func (*EditBox) DeleteCharLeft ¶
func (b *EditBox) DeleteCharLeft()
DeleteCharLeft deletes the character to the left of the cursor and moves the cursor to the position of the deleted character. If the cursor is at the start of the line, the newline is removed.
func (*EditBox) DeleteChars ¶
func (b *EditBox) DeleteChars(n int)
DeleteChars deletes multiple characters starting from the current cursor position.
func (*EditBox) DeleteRow ¶
func (b *EditBox) DeleteRow()
DeleteRow deletes the entire row containing the cursor.
func (*EditBox) Draw ¶
func (b *EditBox) Draw()
Draw updates the contents of the EditBox on the screen.
func (*EditBox) InsertChar ¶
func (b *EditBox) InsertChar(ch rune)
InsertChar inserts a new character at the current cursor position and advances the cursor by one column.
func (*EditBox) InsertRow ¶
func (b *EditBox) InsertRow()
InsertRow inserts a new row at the current cursor position. The cursor moves to the beginning of the inserted row.
func (*EditBox) InsertString ¶
func (b *EditBox) InsertString(s string)
InsertString inserts an entire string at the current cursor position and advances the cursor by the length of the string.
func (*EditBox) LastRow ¶
func (b *EditBox) LastRow() int
LastRow returns the row number of the last row in the buffer.
func (*EditBox) PasteFromClipboard ¶
func (b *EditBox) PasteFromClipboard()
PasteFromClipboard pastes the current clipboard contents to the edit buffer at the current cursor position.
func (*EditBox) Selection ¶
func (b *EditBox) Selection() string
Selection returns the contents of the substring currently selected in the edit buffer.
func (*EditBox) SetView ¶
func (b *EditBox) SetView(x, y int)
SetView adjusts the buffer position currently representing the top-left corner of the visible EditBox.
func (*EditBox) Size ¶
func (b *EditBox) Size() (width, height int)
Size returns the width and height of the EditBox on screen.
type EditBoxFlags ¶
type EditBoxFlags byte
EditBoxFlags define settings for an EditBox.
const ( // EditBoxWordWrap causes the edit box to word-wrap a line of text when // its length reaches the right edge of the screen. EditBoxWordWrap EditBoxFlags = 1 << iota )