tui/modals/modal_info.go
2023-04-24 11:55:04 +02:00

30 lines
533 B
Go

package modals
import (
"git.milar.in/milarin/tui/views"
)
type InfoModal struct {
*views.FrameView
}
func NewInfoModal(message string) *InfoModal {
tv := views.NewTextView(message)
bv := views.NewBorderView(views.NewMarginView(tv, 0, 1, 0, 1))
fv := views.NewFrameView(bv)
fv.DontClearBuffer = true
m := &InfoModal{
FrameView: fv,
}
// m.KeyPressed = func(event *tui.KeyEvent) (consumed bool) {
// // if event.Key() == tcell.KeyEnter || event.Key() == tcell.KeyESC {
// // }
// return true
// }
return m
}