SetIcon sets the icon
(icode string)
| 103 | |
| 104 | // SetIcon sets the icon |
| 105 | func (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 |
| 125 | func (b *ImageButton) SetFontSize(size float64) { |