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

Method SetIcon

gui/image_button.go:105–122  ·  view source on GitHub ↗

SetIcon sets the icon

(icode string)

Source from the content-addressed store, hash-verified

103
104// SetIcon sets the icon
105func (b *ImageButton) SetIcon(icode string) {
106
107 if b.iconLabel == false && b.label != nil {
108 b.Panel.Remove(b.label)
109 b.label.Dispose()
110 b.label = nil
111 }
112
113 b.iconLabel = true
114 if b.label == nil {
115 // Create icon
116 b.label = NewIcon(icode)
117 b.Panel.Add(b.label)
118 } else {
119 b.label.SetText(icode)
120 }
121 b.recalc()
122}
123
124// SetFontSize sets the font size of the label/icon
125func (b *ImageButton) SetFontSize(size float64) {

Callers

nothing calls this directly

Calls 6

recalcMethod · 0.95
NewIconFunction · 0.85
DisposeMethod · 0.65
RemoveMethod · 0.45
AddMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected