diff --git a/Barchart-API.md b/Barchart-API.md index 25d14a1..c384230 100644 --- a/Barchart-API.md +++ b/Barchart-API.md @@ -26,7 +26,7 @@ The following code displays five bars with values 1 through 5 and the relative m ```go func main() { - t, err := termbox.New() + t, err := tcell.New() if err != nil { panic(err) } diff --git a/Binary-tree-layout.md b/Binary-tree-layout.md index 75f0de7..44a1422 100644 --- a/Binary-tree-layout.md +++ b/Binary-tree-layout.md @@ -47,13 +47,13 @@ The **container.New** function is used to construct a container. The API of this To create the terminal layout indicated in the diagram above, the developer can use the following code: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { - return fmt.Errorf("termbox.New => %v", err) + return fmt.Errorf("tcell.New => %v", err) } if _, err := container.New( - tb, + t, container.SplitVertical( container.Left( container.Border(linestyle.Light), @@ -83,4 +83,4 @@ if _, err := container.New( When executed, this results in the following terminal layout: -[[/images/container-api/container_splits_actual.png|container_splits_actual]] \ No newline at end of file +[[/images/container-api/container_splits_actual.png|container_splits_actual]] diff --git a/Container-style.md b/Container-style.md index 54ba458..0df0080 100644 --- a/Container-style.md +++ b/Container-style.md @@ -11,11 +11,11 @@ Containers don't have any borders by default, use one of the following options t The following code shows two containers with different border styles as shown above. The right container has the keyboard focus so its border is highlighted. ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() c, err := container.New( t, @@ -54,11 +54,11 @@ Containers that have a border can also have a text title displayed in the border The following code shows a container with a title in the border that is aligned to the right. ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() c, err := container.New( t, @@ -85,4 +85,4 @@ The **container.BorderTitleAlignCenter** option indicates that the container tit ### [container.BorderTitleAlignRight](https://godoc.org/github.com/mum4k/termdash/container#BorderTitleAlignRight): -The **container.BorderTitleAlignRight** option indicates that the container title should be aligned at the top right corner. \ No newline at end of file +The **container.BorderTitleAlignRight** option indicates that the container title should be aligned at the top right corner. diff --git a/Dynamic-layout.md b/Dynamic-layout.md index 39e5016..32f4c20 100644 --- a/Dynamic-layout.md +++ b/Dynamic-layout.md @@ -29,11 +29,11 @@ The **Container.Update** method applies the specified options to a container wit The following code places a button widget inside a container and then updates the container by replacing the button with a text widget: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() b, err := button.New("hello world", func() error { return nil @@ -69,11 +69,11 @@ When container is updated by adding a new split, any previously placed widgets o The following code places a button widget inside a container and then updates the container by splitting it into two and placing a button and a text widget: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() b, err := button.New("hello world", func() error { return nil @@ -110,4 +110,4 @@ if err := c.Update( ); err != nil { return fmt.Errorf("c.Update => %v", err) } -``` \ No newline at end of file +``` diff --git a/Grid-layout.md b/Grid-layout.md index c1213f4..4008708 100644 --- a/Grid-layout.md +++ b/Grid-layout.md @@ -52,9 +52,9 @@ The **grid.New** function is used to construct a **grid.Builder** instance. The To create the terminal layout indicated in the diagram above, the developer can use the following code: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { - return fmt.Errorf("termbox.New => %v", err) + return fmt.Errorf("tcell.New => %v", err) } b, err := button.New("button", func() error { @@ -107,4 +107,4 @@ if err != nil { When executed, this results in the following terminal layout: -[[/images/grid-api/grid_actual.png|grid_actual]] \ No newline at end of file +[[/images/grid-api/grid_actual.png|grid_actual]] diff --git a/Margin-and-padding.md b/Margin-and-padding.md index a492004..16a796e 100644 --- a/Margin-and-padding.md +++ b/Margin-and-padding.md @@ -55,9 +55,9 @@ The **right** and **left** values are specified as percentage of the container's The following code snippet demonstrates application and effect of margin and padding. The left container has both margin and padding applied. The right container has none of these options. Both containers contain a single button and have a border. ```go -t, err := termbox.New() +t, err := tcell.New() if err != nil { - return fmt.Errorf("termbox.New => %v", err) + return fmt.Errorf("tcell.New => %v", err) } defer t.Close() @@ -107,4 +107,4 @@ if err != nil { The code above results in the following layout: -[[/images/container-api/container_margin_padding_actual.png|container_margin_padding_actual]] \ No newline at end of file +[[/images/container-api/container_margin_padding_actual.png|container_margin_padding_actual]] diff --git a/Placing-widgets.md b/Placing-widgets.md index b720e2a..5bd78a0 100644 --- a/Placing-widgets.md +++ b/Placing-widgets.md @@ -22,11 +22,11 @@ The **container.PlaceWidget** option places the provided widget into the contain The following code places a button widget inside a container as shown above: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() b, err := button.New("hello world", func() error { return nil @@ -55,11 +55,11 @@ horizontally and vertically. The following code aligns the button widget into the top right corner as shown above: ```go -tb, err := termbox.New() +t, err := tcell.New() if err != nil { panic(err) } -defer tb.Close() +defer t.Close() b, err := button.New("hello world", func() error { return nil @@ -86,4 +86,4 @@ The **container.AlignHorizontal** option is used to specify horizontal alignment ### [container.AlignVertical](https://godoc.org/github.com/mum4k/termdash/container#AlignVertical) -The **container.AlignVertical** option is used to specify vertical alignment for the widget. Refer to the [[Align API|align-api]] for alignment options. \ No newline at end of file +The **container.AlignVertical** option is used to specify vertical alignment for the widget. Refer to the [[Align API|align-api]] for alignment options. diff --git a/Termdash-API.md b/Termdash-API.md index e067949..9f889f0 100644 --- a/Termdash-API.md +++ b/Termdash-API.md @@ -40,9 +40,9 @@ The following code snippet starts Termdash with an empty container and no widget ```go // Create the terminal. -t, err := termbox.New() +t, err := tcell.New() if err != nil { - return fmt.Errorf("termbox.New => %v", err) + return fmt.Errorf("tcell.New => %v", err) } defer t.Close() @@ -81,9 +81,9 @@ The following code snippet starts Termdash with an empty container and no widget ```go // Create the terminal. -t, err := termbox.New() +t, err := tcell.New() if err != nil { - return fmt.Errorf("termbox.New => %v", err) + return fmt.Errorf("tcell.New => %v", err) } defer t.Close() @@ -184,4 +184,4 @@ quitter := func(m *terminalapi.Mouse) { if err := termdash.Run(ctx, t, c, termdash.MouseSubscriber(quitter)); err != nil { return fmt.Errorf("termdash.Run => %v", err) } -``` \ No newline at end of file +```