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

Method SetText

gui/slider.go:104–115  ·  view source on GitHub ↗

SetText sets the text of the slider optional label

(text string)

Source from the content-addressed store, hash-verified

102
103// SetText sets the text of the slider optional label
104func (s *Slider) SetText(text string) *Slider {
105
106 if s.label == nil {
107 s.label = NewLabel(text)
108 s.Panel.Add(s.label)
109 } else {
110 s.label.SetText(text)
111 }
112 s.update()
113 s.recalc()
114 return s
115}
116
117// SetValue sets the value of the slider considering the current scale factor
118// and updates its visual appearance.

Callers 1

buildSliderFunction · 0.95

Calls 4

updateMethod · 0.95
recalcMethod · 0.95
NewLabelFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected