SetIcon sets the image label icon from the default Icon font. If there is currently a selected image, it is removed
(icon string)
| 66 | // SetIcon sets the image label icon from the default Icon font. |
| 67 | // If there is currently a selected image, it is removed |
| 68 | func (il *ImageLabel) SetIcon(icon string) { |
| 69 | |
| 70 | if il.image != nil { |
| 71 | il.Panel.Remove(il.image) |
| 72 | il.image = nil |
| 73 | } |
| 74 | if il.icon == nil { |
| 75 | il.icon = NewIcon(icon) |
| 76 | il.icon.SetFontSize(StyleDefault().Label.PointSize * 1.4) |
| 77 | il.Panel.Add(il.icon) |
| 78 | } |
| 79 | il.icon.SetText(icon) |
| 80 | il.recalc() |
| 81 | } |
| 82 | |
| 83 | // SetImageVisible sets the image visibility |
| 84 | func (il *ImageLabel) SetImageVisible(vis bool) { |
no test coverage detected