SetImage sets the image label image
(img *Image)
| 100 | |
| 101 | // SetImage sets the image label image |
| 102 | func (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 |
no test coverage detected