()
| 144 | } |
| 145 | |
| 146 | func (fb *FuncButton) Init() { |
| 147 | fb.Button.Init() |
| 148 | fb.WarnUnadded = true |
| 149 | fb.Styler(func(s *styles.Style) { |
| 150 | if fb.IsReadOnly() { |
| 151 | s.SetAbilities(false, abilities.Hoverable, abilities.Clickable, abilities.Activatable) |
| 152 | s.Cursor = cursors.None |
| 153 | } |
| 154 | }) |
| 155 | fb.OnClick(func(e events.Event) { |
| 156 | if !fb.IsReadOnly() { |
| 157 | fb.CallFunc() |
| 158 | } |
| 159 | }) |
| 160 | } |
| 161 | |
| 162 | // SetText sets the [FuncButton.Text] and updates the tooltip to |
| 163 | // correspond to the new name. |
nothing calls this directly
no test coverage detected