This commit is contained in:
2025-06-19 06:07:07 -05:00
parent 74dd092a99
commit 5988d048c1
14 changed files with 391 additions and 42 deletions

10
menu.go
View File

@@ -51,15 +51,17 @@ const (
)
func NewMenu(id string, style tcell.Style) *Menu {
ret := &Menu{style: style}
ret.Init(id)
ret := &Menu{}
ret.Init(id, style)
return ret
}
func (w *Menu) Id() string { return w.id }
func (w *Menu) Init(id string) {
func (w *Menu) Init(id string, style tcell.Style) {
w.id = id
w.style = style
w.visible = true
}
func (w *Menu) Id() string { return w.id }
func (w *Menu) HandleResize(ev *tcell.EventResize) {}
func (w *Menu) HandleKey(ev *tcell.EventKey) bool {
if !w.active {