MCPcopy Index your code
hub / github.com/g3n/engine / SetImage

Method SetImage

gui/imagelabel.go:102–116  ·  view source on GitHub ↗

SetImage sets the image label image

(img *Image)

Source from the content-addressed store, hash-verified

100
101// SetImage sets the image label image
102func (il *ImageLabel) SetImage(img *Image) {
103
104 if il.icon != nil {
105 il.Panel.Remove(il.icon)
106 il.icon = nil
107 }
108 if il.image != nil {
109 il.Panel.Remove(il.image)
110 }
111 il.image = img
112 if img != nil {
113 il.Panel.Add(il.image)
114 }
115 il.recalc()
116}
117
118// SetImageFromFile sets the image label image from the specified filename
119// If there is currently a selected icon, it is removed

Callers 1

SetImageFromFileMethod · 0.95

Calls 3

recalcMethod · 0.95
RemoveMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected