| 1 | package mainscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview/demos/presentation`/ |
| 2 | |
| 3 | import ( |
| 4 | "github.com/gdamore/tcell/v2scip-go gomod github.com/gdamore/tcell/v2 v2.7.4 `github.com/gdamore/tcell/v2`/" |
| 5 | "github.com/darkhz/tviewscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/" |
| 6 | ) |
| 7 | |
| 8 | const helloWorldscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview/demos/presentation`/helloWorld. = `[green]package[white] main |
| 9 | |
| 10 | [green]import[white] ( |
| 11 | [red]"github.com/darkhz/tview"[white] |
| 12 | ) |
| 13 | |
| 14 | [green]func[white] [yellow]main[white]() { |
| 15 | box := tview.[yellow]NewBox[white](). |
| 16 | [yellow]SetBorder[white](true). |
| 17 | [yellow]SetTitle[white]([red]"Hello, world!"[white]) |
| 18 | tview.[yellow]NewApplication[white](). |
| 19 | [yellow]SetRoot[white](box, true). |
| 20 | [yellow]Run[white]() |
| 21 | }` |
| 22 | |
| 23 | // HelloWorld shows a simple "Hello world" example. |
| 24 | func HelloWorldscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview/demos/presentation`/HelloWorld().(nextSlide func()) (title string, content tviewscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/.Primitivescip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/Primitive#) { |
| 25 | // We use a text view because we want to capture keyboard input. |
| 26 | textView := tviewscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/.NewTextViewscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/NewTextView().().SetDoneFuncscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/TextView#SetDoneFunc().(func(key tcellscip-go gomod github.com/gdamore/tcell/v2 v2.7.4 `github.com/gdamore/tcell/v2`/.Keyscip-go gomod github.com/gdamore/tcell/v2 v2.7.4 `github.com/gdamore/tcell/v2`/Key#) { |
| 27 | nextSlide() |
| 28 | }) |
| 29 | textView.SetBorderscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/Box#SetBorder().(true).SetTitlescip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview`/Box#SetTitle().("Hello, world!") |
| 30 | return "Hello, world", Codescip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview/demos/presentation`/Code().(textView, 30, 10, helloWorldscip-go gomod github.com/darkhz/tview . `github.com/darkhz/tview/demos/presentation`/helloWorld.) |
| 31 | } |