aboutsummaryrefslogtreecommitdiff
path: root/src/alert.go
blob: 917d08985a182ac1180062b3c2798bb7231e569d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package src

import (
	"fmt"

	"github.com/rivo/tview"
)

func alert(a *app, format string, params ...interface{}) {
	modal := tview.NewModal().
		SetText(fmt.Sprintf(format, params...)).
		AddButtons([]string{"OK"}).
		SetDoneFunc(func(_ int, _ string) {
			a.pages.RemovePage("alert")
		})

	a.pages.AddPage("alert", modal, true, true)
}