SetImage sets the button left image from the specified filename If there is currently a selected icon, it is removed
(imgfile string)
| 99 | // SetImage sets the button left image from the specified filename |
| 100 | // If there is currently a selected icon, it is removed |
| 101 | func (b *Button) SetImage(imgfile string) error { |
| 102 | |
| 103 | img, err := NewImage(imgfile) |
| 104 | if err != nil { |
| 105 | return err |
| 106 | } |
| 107 | if b.image != nil { |
| 108 | b.Panel.Remove(b.image) |
| 109 | } |
| 110 | b.image = img |
| 111 | b.Panel.Add(b.image) |
| 112 | b.recalc() |
| 113 | return nil |
| 114 | } |
| 115 | |
| 116 | // SetStyles set the button styles overriding the default style |
| 117 | func (b *Button) SetStyles(bs *ButtonStyles) { |
no test coverage detected