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

Function handleText

htmlcore/handler.go:272–279  ·  view source on GitHub ↗

handleText creates a new [core.Text] from the given information, setting the text and the text click function so that URLs are opened according to [Context.OpenURL].

(ctx *Context)

Source from the content-addressed store, hash-verified

270// handleText creates a new [core.Text] from the given information, setting the text and
271// the text click function so that URLs are opened according to [Context.OpenURL].
272func handleText(ctx *Context) *core.Text {
273 tx := New[core.Text](ctx).SetText(ExtractText(ctx))
274 tx.Styler(textStyler)
275 tx.HandleTextClick(func(tl *paint.TextLink) {
276 ctx.OpenURL(tl.URL)
277 })
278 return tx
279}
280
281// handleTextTag creates a new [core.Text] from the given information, setting the text and
282// the text click function so that URLs are opened according to [Context.OpenURL]. Also,

Callers 1

handleElementFunction · 0.85

Calls 5

ExtractTextFunction · 0.85
StylerMethod · 0.80
HandleTextClickMethod · 0.80
OpenURLMethod · 0.65
SetTextMethod · 0.45

Tested by

no test coverage detected