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

Method update

gui/button.go:180–195  ·  view source on GitHub ↗

update updates the button visual state

()

Source from the content-addressed store, hash-verified

178
179// update updates the button visual state
180func (b *Button) update() {
181
182 if !b.Enabled() {
183 b.applyStyle(&b.styles.Disabled)
184 return
185 }
186 if b.pressed && b.mouseOver {
187 b.applyStyle(&b.styles.Pressed)
188 return
189 }
190 if b.mouseOver {
191 b.applyStyle(&b.styles.Over)
192 return
193 }
194 b.applyStyle(&b.styles.Normal)
195}
196
197// applyStyle applies the specified button style
198func (b *Button) applyStyle(bs *ButtonStyle) {

Callers 6

SetIconMethod · 0.95
SetStylesMethod · 0.95
onCursorMethod · 0.95
onMouseMethod · 0.95
onKeyMethod · 0.95
NewButtonFunction · 0.45

Calls 2

applyStyleMethod · 0.95
EnabledMethod · 0.65

Tested by

no test coverage detected