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

Function init

core/textfield.go:1289–1305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1287)
1288
1289func init() {
1290 TheApp.AddQuitCleanFunc(textFieldBlinker.QuitClean)
1291 textFieldBlinker.Func = func() {
1292 w := textFieldBlinker.Widget
1293 if w == nil {
1294 return
1295 }
1296 tf := AsTextField(w)
1297 if !w.AsWidget().StateIs(states.Focused) || !w.AsWidget().IsVisible() {
1298 tf.blinkOn = false
1299 tf.renderCursor(false)
1300 } else {
1301 tf.blinkOn = !tf.blinkOn
1302 tf.renderCursor(tf.blinkOn)
1303 }
1304 }
1305}
1306
1307// startCursor starts the cursor blinking and renders it
1308func (tf *TextField) startCursor() {

Callers

nothing calls this directly

Calls 6

AsTextFieldFunction · 0.85
StateIsMethod · 0.80
AddQuitCleanFuncMethod · 0.65
AsWidgetMethod · 0.65
IsVisibleMethod · 0.65
renderCursorMethod · 0.45

Tested by

no test coverage detected