mirror of
https://github.com/boolean-maybe/tiki
synced 2026-04-21 13:37:20 +00:00
21 lines
464 B
Go
21 lines
464 B
Go
package app
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/rivo/tview"
|
|
)
|
|
|
|
// NewApp creates a tview application.
|
|
func NewApp() *tview.Application {
|
|
return tview.NewApplication()
|
|
}
|
|
|
|
// Run runs the tview application with the given root primitive (typically a tview.Pages).
|
|
func Run(app *tview.Application, root tview.Primitive) error {
|
|
app.SetRoot(root, true).EnableMouse(false)
|
|
if err := app.Run(); err != nil {
|
|
return fmt.Errorf("run application: %w", err)
|
|
}
|
|
return nil
|
|
}
|