This repository has been archived on 2021-03-25. You can view files and clone it, but cannot push or open issues/pull-requests.
tui/example/simple/main.go

44 lines
945 B
Go

package main
import (
"git.crumpington.com/public/tui"
)
func main() {
tui.Start()
defer tui.Stop()
pwd := tui.GetPassword("Password: ")
tui.PrintString("Got %s", pwd)
tui.GetString("...")
c := tui.GetMenu(
"Menu",
"Some long or short text.",
"aa", "Accessory long text description with some other stuff. Whatever.",
"b", "Bass",
"c", "Case",
"e", "Email address\n\naddr")
tui.PrintString("Got %s", c)
tui.GetString("...")
tui.PrintLine()
tui.GetString("What would you like? ")
tui.Clear()
tui.GetString("...")
tui.Clear()
tui.PrintBoxed("the rain in spain falls mainly in the plane. The rain in spain falls mainlyx in the plane.")
tui.GetString("...")
tui.Clear()
tui.PrintTextWithPrefix(" ", "the rain in spain falls mainly in the plane. The rain in spain fallsxxx mainly in the plane.")
tui.GetString("...")
tui.Clear()
i := tui.GetInt("an integer: ")
tui.PrintTextWithPrefix("", "Got %d", i)
}