Documentation ¶
Overview ¶
Package widget implements state tracking and event handling of common user interface controls. To draw widgets, use a theme packages such as package gioui.org/widget/material.
Index ¶
- type Button
- type ChangeEvent
- type CheckBox
- type Click
- type Editor
- func (e *Editor) Delete(runes int)
- func (e *Editor) Events(gtx *layout.Context) []EditorEvent
- func (e *Editor) Focus()
- func (e *Editor) Insert(s string)
- func (e *Editor) Layout(gtx *layout.Context, sh *text.Shaper, font text.Font)
- func (e *Editor) Len() int
- func (e *Editor) Move(distance int)
- func (e *Editor) PaintCaret(gtx *layout.Context)
- func (e *Editor) PaintText(gtx *layout.Context)
- func (e *Editor) SetText(s string)
- func (e *Editor) Text() string
- type EditorEvent
- type Enum
- type Label
- type SubmitEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeEvent ¶
type ChangeEvent struct{}
A ChangeEvent is generated for every user change to the text.
type CheckBox ¶
type CheckBox struct {
// contains filtered or unexported fields
}
func (*CheckBox) SetChecked ¶
type Editor ¶
type Editor struct { Alignment text.Alignment // SingleLine force the text to stay on a single line. // SingleLine also sets the scrolling direction to // horizontal. SingleLine bool // Submit enabled translation of carriage return keys to SubmitEvents. // If not enabled, carriage returns are inserted as newlines in the text. Submit bool // contains filtered or unexported fields }
Editor implements an editable and scrollable text area.
func (*Editor) Delete ¶
Delete runes from the caret position. The sign of runes specifies the direction to delete: positive is forward, negative is backward.
func (*Editor) Events ¶
func (e *Editor) Events(gtx *layout.Context) []EditorEvent
Events returns available editor events.
func (*Editor) Move ¶
Move the caret: positive distance moves forward, negative distance moves backward.
func (*Editor) PaintCaret ¶
type EditorEvent ¶
type EditorEvent interface {
// contains filtered or unexported methods
}
type Enum ¶
type Enum struct {
// contains filtered or unexported fields
}
type Label ¶
type Label struct { // Alignment specify the text alignment. Alignment text.Alignment // MaxLines limits the number of lines. Zero means no limit. MaxLines int }
Label is a widget for laying out and drawing text.
type SubmitEvent ¶
type SubmitEvent struct {
Text string
}
A SubmitEvent is generated when Submit is set and a carriage return key is pressed.