Terminal-based user interface toolkit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
896 B

package main
import (
const helloWorld = `[green]package[white] main
[green]import[white] (
[green]func[white] [yellow]main[white]() {
box := cview.[yellow]NewBox[white]().
[yellow]SetTitle[white]([red]"Hello, world!"[white])
[yellow]SetRoot[white](box, true).
// HelloWorld shows a simple "Hello world" example.
func HelloWorld(nextSlide func()) (title string, content cview.Primitive) {
// We use a text view because we want to capture keyboard input.
textView := cview.NewTextView().SetDoneFunc(func(key tcell.Key) {
textView.SetBorder(true).SetTitle("Hello, world!")
return "Hello, world", Code(textView, 30, 10, helloWorld)