Documentation ¶
Index ¶
- func TextWidth(s string) float32
- func WrapInputtextMultiline(e *TextEditor, data imgui.InputTextCallbackData) int32
- type TextEditor
- func (e *TextEditor) AutoSelect() bool
- func (e *TextEditor) Build()
- func (e *TextEditor) SetAutoSelect(on bool)
- func (e *TextEditor) SetOnActivate(callback func(e *TextEditor))
- func (e *TextEditor) SetSize(width, height float32)
- func (e *TextEditor) SetText(s string)
- func (e *TextEditor) SetWordwrap(on bool)
- func (e *TextEditor) Size() (float32, float32)
- func (e *TextEditor) Text() string
- func (e *TextEditor) Widget() g.Widget
- func (e *TextEditor) Wordrap() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapInputtextMultiline ¶
func WrapInputtextMultiline(e *TextEditor, data imgui.InputTextCallbackData) int32
WrapInputTextMultiline is a callback to wrap an input text multiline.
Types ¶
type TextEditor ¶
type TextEditor struct {
// contains filtered or unexported fields
}
func NewTextEditor ¶
func NewTextEditor(width, height float32, onActivate func(e *TextEditor)) *TextEditor
NewTextEditor creates a new text editor with given height and width. The onActivate callback is called when the editor is activated.
func NewTextEditorMultiline ¶
func NewTextEditorMultiline(width, height float32) *TextEditor
NewTextEditorMultiline creates a new multiline text editor with given width and height. Word-wrapping is ON by default.
func (*TextEditor) AutoSelect ¶
func (e *TextEditor) AutoSelect() bool
AutoSelect returns true if text is automatically selected on focus, false otherwise.
func (*TextEditor) Build ¶
func (e *TextEditor) Build()
Build builds the widget's layout. This is to satisfy Giu's custom widget interface.
func (*TextEditor) SetAutoSelect ¶
func (e *TextEditor) SetAutoSelect(on bool)
SetAutoSelect sets the automatic selection on focus feature.
func (*TextEditor) SetOnActivate ¶
func (e *TextEditor) SetOnActivate(callback func(e *TextEditor))
SetOnActivate sets the onActivate callback which is called when the editor is activated.
func (*TextEditor) SetSize ¶
func (e *TextEditor) SetSize(width, height float32)
SetSize sets the editor width and height. Widths and heights of -1 indicate maximum stretch.
func (*TextEditor) SetText ¶
func (e *TextEditor) SetText(s string)
SetText sets the editor text to the given UTF-8 string.
func (*TextEditor) SetWordwrap ¶
func (e *TextEditor) SetWordwrap(on bool)
SetWordwrap sets the automatic word wrapping on or off.
func (*TextEditor) Size ¶
func (e *TextEditor) Size() (float32, float32)
Size returns the width and height of the editor. Widths and heights of -1 indicate maximum stretch.
func (*TextEditor) Widget ¶
func (e *TextEditor) Widget() g.Widget
Widget returns the undlerying GUI widget, which is either a InputText or InputTextMultiline.
func (*TextEditor) Wordrap ¶
func (e *TextEditor) Wordrap() bool
Wordwrap returns true if the automatic word wrapping is on, false otherwise.