类型 TextInputContext
API 文档由 Go 源码生成,内容为英文。
type TextInputContext struct {
ID ui.ID
Bounds ui.Rect
// Layer is the compositing layer captured by the focused hit.
Layer uint16
Multiline bool
ReadOnly bool
Secure bool
// NavigationKeys reports a field that asked for Up, Down, PageUp and
// PageDown to be delivered to the application as raw ui.KeyEvents.
NavigationKeys bool
// Terminal reports a RoleTerminal hit. The native editor then is a
// preedit surface in the fixed-pitch font: it draws only the text being
// composed, with no caret or selection, and Bounds should be the cursor
// cell. Plain keys reach the application as TextInsert events and the
// rest as raw ui.KeyEvents (see ui.KeyEvent).
Terminal bool
// TextBounds, FontSize and TextColor are the text geometry the component
// declared for this field. They fill whatever the returned TextInput leaves
// unset, so a bare &TextInput{Editor: editor} draws its text exactly where
// the field painted it; set them only to deliberately override.
TextBounds ui.Rect
FontSize float32
TextColor ui.Color
}TextInputContext describes the focused Canvas text-field hit.