MCPcopy Create free account
hub / github.com/cogentcore/core / SetText

Method SetText

texteditor/buffer.go:200–205  ·  view source on GitHub ↗

SetText sets the text to the given bytes. Pass nil to initialize an empty buffer.

(text []byte)

Source from the content-addressed store, hash-verified

198// SetText sets the text to the given bytes.
199// Pass nil to initialize an empty buffer.
200func (tb *Buffer) SetText(text []byte) *Buffer {
201 tb.Init()
202 tb.Lines.SetText(text)
203 tb.signalEditors(bufferNew, nil)
204 return tb
205}
206
207// SetString sets the text to the given string.
208func (tb *Buffer) SetString(txt string) *Buffer {

Callers 15

InitMethod · 0.95
handleElementFunction · 0.95
NewBufferFunction · 0.95
SetStringMethod · 0.95
OpenFSMethod · 0.95
openFileMethod · 0.95
CloseMethod · 0.95
MakeHeaderMethod · 0.45
MakeToolbarMethod · 0.45
InitMethod · 0.45
InitMethod · 0.45
InitMethod · 0.45

Calls 2

InitMethod · 0.95
signalEditorsMethod · 0.95

Tested by

no test coverage detected