MCPcopy
hub / github.com/g3n/engine / update

Method update

gui/edit.go:310–325  ·  view source on GitHub ↗

update updates the visual state

()

Source from the content-addressed store, hash-verified

308
309// update updates the visual state
310func (ed *Edit) update() {
311
312 if !ed.Enabled() {
313 ed.applyStyle(&ed.styles.Disabled)
314 return
315 }
316 if ed.cursorOver {
317 ed.applyStyle(&ed.styles.Over)
318 return
319 }
320 if ed.focus {
321 ed.applyStyle(&ed.styles.Focus)
322 return
323 }
324 ed.applyStyle(&ed.styles.Normal)
325}
326
327// applyStyle applies the specified style
328func (ed *Edit) applyStyle(s *EditStyle) {

Callers 5

SetTextMethod · 0.95
SetStylesMethod · 0.95
OnFocusLostMethod · 0.95
onCursorMethod · 0.95
NewEditFunction · 0.45

Calls 2

applyStyleMethod · 0.95
EnabledMethod · 0.65

Tested by

no test coverage detected