34 lines
670 B
Go
34 lines
670 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/gdamore/tcell/v2"
|
|
"github.com/rivo/tview"
|
|
|
|
"git.bonsai.cool/kayprish/ck/drw"
|
|
"git.bonsai.cool/kayprish/ck/util"
|
|
)
|
|
|
|
func main() {
|
|
util.Today = time.Now()
|
|
util.SelTime = util.Today
|
|
|
|
box := tview.NewBox().
|
|
SetBorder(true).
|
|
SetTitle("Зидни Календар").
|
|
SetDrawFunc(drw.DrawWall).
|
|
SetInputCapture(drw.WallInputCapture)
|
|
|
|
app := tview.NewApplication()
|
|
app.SetRoot(box, true).
|
|
SetInputCapture(func(ev *tcell.EventKey) *tcell.EventKey {
|
|
if ev.Key() == tcell.KeyEscape || ev.Rune() == 'Q' || ev.Rune() == 'q' {
|
|
app.Stop()
|
|
}
|
|
return ev
|
|
})
|
|
if err := app.Run(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|