Last active
April 4, 2017 09:38
-
-
Save christophberger/f583ed7c0071e6035cf1b1958d37a7d8 to your computer and use it in GitHub Desktop.
Code snippet from github.com/appliedgo/tui: start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// Under normal circumstances, importing two UI libraries at the | |
// same time is probably not a good idea, as each has its own event | |
// loop. This demo code takes care of using only one of these | |
// libraries at a time. | |
import ( | |
"fmt" | |
"log" | |
"os" | |
// Both TUI packages are abbreviated to avoid making the code | |
// overly verbose. | |
t "github.com/gizak/termui" | |
c "github.com/jroimartin/gocui" | |
"github.com/pkg/errors" | |
) | |
const ( | |
// List box width. | |
lw = 20 | |
// Input box height. | |
ih = 3 | |
) | |
// Items to fill the list with. | |
var listItems = []string{ | |
"Line 1", | |
"Line 2", | |
"Line 3", | |
"Line 4", | |
"Line 5", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment