Using Pages so that Notifications can be displayed

Pages allow overlaying of primitives.
This commit is contained in:
aditya-K2 2021-11-13 16:40:33 +05:30
parent 459b6b2f02
commit e2fd4c117e

7
App.go
View File

@ -13,6 +13,7 @@ type Application struct {
Navbar *tview.Table Navbar *tview.Table
searchBar *tview.Table searchBar *tview.Table
pBar *progressBar pBar *progressBar
Pages *tview.Pages
} }
func newApplication(r *Renderer) *Application { func newApplication(r *Renderer) *Application {
@ -51,8 +52,11 @@ func newApplication(r *Renderer) *Application {
expandedView.SetBorderPadding(1, 1, 1, 1).SetBorder(true) expandedView.SetBorderPadding(1, 1, 1, 1).SetBorder(true)
expandedView.SetSelectable(true, false) expandedView.SetSelectable(true, false)
rootPages := tview.NewPages()
rootPages.AddPage("Main", mainFlex, true, true)
App := tview.NewApplication() App := tview.NewApplication()
App.SetRoot(mainFlex, true).SetFocus(expandedView) App.SetRoot(rootPages, true).SetFocus(expandedView)
return &Application{ return &Application{
App: App, App: App,
@ -60,6 +64,7 @@ func newApplication(r *Renderer) *Application {
Navbar: Navbar, Navbar: Navbar,
searchBar: searchBar, searchBar: searchBar,
pBar: pBar, pBar: pBar,
Pages: rootPages,
} }
} }