start work on go rewrite for stable release
This commit is contained in:
parent
1fc61e5842
commit
62635076c3
9 changed files with 344 additions and 36 deletions
28
internal/tuimode/tuimode.go
Normal file
28
internal/tuimode/tuimode.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package tuimode
|
||||
|
||||
import (
|
||||
"code.rocketnine.space/tslocum/cview"
|
||||
)
|
||||
|
||||
func App() {
|
||||
// Create a TUI app
|
||||
app := cview.NewApplication()
|
||||
defer app.HandlePanic()
|
||||
app.EnableMouse(true)
|
||||
|
||||
// Generate flex grid
|
||||
flex := cview.NewFlex()
|
||||
flex.SetDirection(cview.FlexRow)
|
||||
|
||||
tv := cview.NewTextView()
|
||||
tv.SetBorder(true)
|
||||
tv.SetTitle("Hello, world!")
|
||||
tv.SetText("Lorem ipsum dolor sit amet")
|
||||
flex.AddItem(tv, 0, 0, true)
|
||||
flex.AddItem(tv, 0, 1, false)
|
||||
|
||||
app.SetRoot(flex, true)
|
||||
if err := app.Run(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue