aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/gizak/termui/example/list.go
blob: d33a3616c41ca7f3ff040773734f91c1b98d68f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
// Use of this source code is governed by a MIT license that can
// be found in the LICENSE file.

// +build ignore

package main

import "github.com/gizak/termui"

func main() {
    err := termui.Init()
    if err != nil {
        panic(err)
    }
    defer termui.Close()

    termui.UseTheme("helloworld")

    strs := []string{
        "[0] github.com/gizak/termui",
        "[1] 你好,世界",
        "[2] こんにちは世界",
        "[3] keyboard.go",
        "[4] output.go",
        "[5] random_out.go",
        "[6] dashboard.go",
        "[7] nsf/termbox-go"}

    ls := termui.NewList()
    ls.Items = strs
    ls.ItemFgColor = termui.ColorYellow
    ls.Border.Label = "List"
    ls.Height = 7
    ls.Width = 25
    ls.Y = 0

    termui.Render(ls)

    <-termui.EventCh()
}