forked from tslocum/cview
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.
22 lines
566 B
22 lines
566 B
// Demo code for the List primitive. |
|
package main |
|
|
|
import ( |
|
"gitlab.com/tslocum/cview" |
|
) |
|
|
|
func main() { |
|
app := cview.NewApplication() |
|
list := cview.NewList(). |
|
AddItem("List item 1", "Some explanatory text", 'a', nil). |
|
AddItem("List item 2", "Some explanatory text", 'b', nil). |
|
AddItem("List item 3", "Some explanatory text", 'c', nil). |
|
AddItem("List item 4", "Some explanatory text", 'd', nil). |
|
AddItem("Quit", "Press to exit", 'q', func() { |
|
app.Stop() |
|
}) |
|
app.EnableMouse() |
|
if err := app.SetRoot(list, true).Run(); err != nil { |
|
panic(err) |
|
} |
|
}
|
|
|