Skip to content

Instantly share code, notes, and snippets.

@christophberger
Last active April 4, 2017 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophberger/f583ed7c0071e6035cf1b1958d37a7d8 to your computer and use it in GitHub Desktop.
Save christophberger/f583ed7c0071e6035cf1b1958d37a7d8 to your computer and use it in GitHub Desktop.
Code snippet from github.com/appliedgo/tui: start
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