func (b *Button) OnActivated(fn func(b *Button)) {
	b.onActivated = fn
}
OnActivated allows a custom function to be run whenever the button is activated.
package tui
import (
	"image"
	"strings"
)
var _ Widget = &Button{}
type Button struct {
	WidgetBase
	text string
	onActivated func(*Button)
}
func NewButton(text string) *Button {
	return &Button{
		text: text,
	}
}
func (b *Button) Draw(p *Painter) {
	style := "button"
	if b.IsFocused() {
		style += ".focused"
	}
	p.WithStyle(style, func(p *Painter) {
		lines := strings.Split(b.text, "\n")
		for i, line := range lines {
			p.FillRect(0, i, b.Size().X, 1)
			p.DrawText(0, i, line)
		}
	})
}
func (b *Button) SizeHint() image.Point {
	if len(b.text) == 0 {
		return b.MinSizeHint()
	}
	var size image.Point
	lines := strings.Split(b.text, "\n")
	for _, line := range lines {
		if w := stringWidth(line); w > size.X {
			size.X = w
		}
	}
	size.Y = len(lines)
	return size
}
func (b *Button) OnKeyEvent(ev KeyEvent) {
	if !b.IsFocused() {
		return
	}
	if ev.Key == KeyEnter && b.onActivated != nil {
		b.onActivated(b)
	}
}