SetText sets the text of the label
(text string)
| 83 | |
| 84 | // SetText sets the text of the label |
| 85 | func (b *ImageButton) SetText(text string) { |
| 86 | |
| 87 | if b.iconLabel && b.label != nil { |
| 88 | b.Panel.Remove(b.label) |
| 89 | b.label.Dispose() |
| 90 | b.label = nil |
| 91 | } |
| 92 | |
| 93 | b.iconLabel = false |
| 94 | if b.label == nil { |
| 95 | // Create label |
| 96 | b.label = NewLabel(text) |
| 97 | b.Panel.Add(b.label) |
| 98 | } else { |
| 99 | b.label.SetText(text) |
| 100 | } |
| 101 | b.recalc() |
| 102 | } |
| 103 | |
| 104 | // SetIcon sets the icon |
| 105 | func (b *ImageButton) SetIcon(icode string) { |