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"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
bc := ui.NewBarChart()
|
bc := ui.NewBarChart()
|
||||||
|
@ -14,7 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
p := ui.NewPar(":PRESS q TO QUIT DEMO")
|
p := ui.NewPar(":PRESS q TO QUIT DEMO")
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
g0 := ui.NewGauge()
|
g0 := ui.NewGauge()
|
||||||
|
@ -14,7 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
sinps := (func() []float64 {
|
sinps := (func() []float64 {
|
||||||
|
@ -13,7 +13,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
sinps := (func() map[string][]float64 {
|
sinps := (func() map[string][]float64 {
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
strs := []string{
|
strs := []string{
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
bc := ui.NewMBarChart()
|
bc := ui.NewMBarChart()
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
par0 := ui.NewPar("Borderless Text")
|
par0 := ui.NewPar("Borderless Text")
|
||||||
|
@ -12,7 +12,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
rand.Seed(time.Now().UTC().UnixNano())
|
rand.Seed(time.Now().UTC().UnixNano())
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
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}
|
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"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
rows1 := [][]string{
|
rows1 := [][]string{
|
||||||
|
@ -12,7 +12,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
header := ui.NewPar("Press q to quit, Press j or k to switch tabs")
|
header := ui.NewPar("Press q to quit, Press j or k to switch tabs")
|
||||||
|
@ -14,7 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
|
@ -276,7 +276,10 @@ func main() {
|
|||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
panic("Currently works only on Linux")
|
panic("Currently works only on Linux")
|
||||||
}
|
}
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
defer ui.Close()
|
||||||
|
|
||||||
termWidth := 70
|
termWidth := 70
|
||||||
|
@ -9,7 +9,10 @@ package main
|
|||||||
import ui "github.com/gizak/termui"
|
import ui "github.com/gizak/termui"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ui.Init()
|
err := ui.Init()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer ui.Close()
|
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.")
|
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
Block a user