1
0
mirror of https://github.com/gizak/termui.git synced 2025-04-24 13:48:50 +08:00
termui/misc.go
Caleb Bassi 08e68490f3 Add TextBox widget
- TextBox is a superset of Paragraph, so Paragraph is deprecated
- adds support for a cursor, which can be moved
- the `Text` field is now private, replaced with `SetText`, `InsertText`, and `ClearText` methods

TODO:

- adding focusable widgets support to termui might clean up the API since we could potentially move the event handling from client side to library side
- add support for scrolling the TextBox view
- fix the cursor position on linewrap
- fix linewrapping
- add line number support
2019-03-15 22:40:01 -07:00

24 lines
317 B
Go

package termui
import (
"strings"
)
var PRINTABLE_KEYS = append(
strings.Split(
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./<>?;:'\"[]\\{}|`~!@#$%^&*()-_=+",
"",
),
"<Space>",
"<Tab>",
"<Enter>",
)
type Alignment uint
const (
AlignLeft Alignment = iota
AlignCenter
AlignRight
)