File: main.go

package info (click to toggle)
golang-github-rivo-tview 0.0~git20210122.745e4ce-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 3,564 kB
  • sloc: makefile: 3
file content (15 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Demo code for the Button primitive.
package main

import "github.com/rivo/tview"

func main() {
	app := tview.NewApplication()
	button := tview.NewButton("Hit Enter to close").SetSelectedFunc(func() {
		app.Stop()
	})
	button.SetBorder(true).SetRect(0, 0, 22, 3)
	if err := app.SetRoot(button, false).EnableMouse(true).Run(); err != nil {
		panic(err)
	}
}