mirror of https://github.com/gizak/termui.git
Readd explicit error handling to examples
This commit is contained in:
parent
f4dc75130f
commit
00d684343a
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
bc := ui.NewBarChart()
|
||||
|
|
|
@ -14,7 +14,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
p := ui.NewPar(":PRESS q TO QUIT DEMO")
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
g0 := ui.NewGauge()
|
||||
|
|
|
@ -14,7 +14,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
sinps := (func() []float64 {
|
||||
|
|
|
@ -13,7 +13,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
sinps := (func() map[string][]float64 {
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
strs := []string{
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
bc := ui.NewMBarChart()
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
par0 := ui.NewPar("Borderless Text")
|
||||
|
|
|
@ -12,7 +12,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
data := []int{4, 2, 1, 6, 3, 9, 1, 4, 2, 15, 14, 9, 8, 6, 10, 13, 15, 12, 10, 5, 3, 6, 1, 7, 10, 10, 14, 13, 6}
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
rows1 := [][]string{
|
||||
|
|
|
@ -12,7 +12,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
header := ui.NewPar("Press q to quit, Press j or k to switch tabs")
|
||||
|
|
|
@ -14,7 +14,10 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
// Deprecated
|
||||
|
|
|
@ -276,7 +276,10 @@ func main() {
|
|||
if runtime.GOOS != "linux" {
|
||||
panic("Currently works only on Linux")
|
||||
}
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
termWidth := 70
|
||||
|
|
|
@ -9,7 +9,10 @@ package main
|
|||
import ui "github.com/gizak/termui"
|
||||
|
||||
func main() {
|
||||
ui.Init()
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
p := ui.NewPar("Press q to QUIT THE DEMO. [There](fg-blue) are other things [that](fg-red) are going to fit in here I think. What do you think? Now is the time for all good [men to](bg-blue) come to the aid of their country. [This is going to be one really really really long line](fg-green) that is going to go together and stuffs and things. Let's see how this thing renders out.\n Here is a new paragraph and stuffs and things. There should be a tab indent at the beginning of the paragraph. Let's see if that worked as well.")
|
||||
|
|
Loading…
Reference in New Issue