MCPcopy Create free account
hub / github.com/gioui/gio / SetText

Method SetText

widget/selectable.go:159–166  ·  view source on GitHub ↗

SetText updates the text to s if it does not already contain s. Updating the text will clear the selection unless the selectable already contains s.

(s string)

Source from the content-addressed store, hash-verified

157// SetText updates the text to s if it does not already contain s. Updating the
158// text will clear the selection unless the selectable already contains s.
159func (l *Selectable) SetText(s string) {
160 l.initialize()
161 if l.lastValue != s {
162 l.source = newStringSource(s)
163 l.lastValue = s
164 l.text.SetSource(l.source)
165 }
166}
167
168// Truncated returns whether the text has been truncated by the text shaper to
169// fit within available constraints.

Callers

nothing calls this directly

Calls 3

initializeMethod · 0.95
newStringSourceFunction · 0.85
SetSourceMethod · 0.45

Tested by

no test coverage detected