mirror of
https://github.com/mum4k/termdash.git
synced 2025-04-25 13:48:50 +08:00
Making tcell the default in all demos and examples.
This commit is contained in:
parent
b698e3f93c
commit
3cbd993521
@ -30,7 +30,7 @@ import (
|
||||
"github.com/mum4k/termdash/private/draw/testdraw"
|
||||
"github.com/mum4k/termdash/private/faketerm"
|
||||
"github.com/mum4k/termdash/private/fakewidget"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/widgetapi"
|
||||
"github.com/mum4k/termdash/widgets/barchart"
|
||||
)
|
||||
@ -38,7 +38,7 @@ import (
|
||||
// Shows how to create a simple 4x4 grid with four widgets.
|
||||
// All the cells in the grid contain the same widget in this example.
|
||||
func Example() {
|
||||
tbx, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -82,7 +82,7 @@ func Example() {
|
||||
// Shows how to create rows iteratively. Each row contains two columns and each
|
||||
// column contains the same widget.
|
||||
func Example_iterative() {
|
||||
tbx, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ import (
|
||||
"github.com/mum4k/termdash/private/event/testevent"
|
||||
"github.com/mum4k/termdash/private/faketerm"
|
||||
"github.com/mum4k/termdash/private/fakewidget"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgetapi"
|
||||
"github.com/mum4k/termdash/widgets/barchart"
|
||||
@ -42,7 +42,7 @@ import (
|
||||
// Example shows how to setup and run termdash with periodic redraw.
|
||||
func Example() {
|
||||
// Create the terminal.
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -86,7 +86,7 @@ func Example() {
|
||||
// Example shows how to setup and run termdash with manually triggered redraw.
|
||||
func Example_triggered() {
|
||||
// Create the terminal.
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -477,8 +477,8 @@ const (
|
||||
|
||||
func main() {
|
||||
terminalPtr := flag.String("terminal",
|
||||
"termbox",
|
||||
"The terminal implementation to use. Available implementations are 'termbox' and 'tcell' (default = termbox).")
|
||||
"tcell",
|
||||
"The terminal implementation to use. Available implementations are 'termbox' and 'tcell' (default = tcell).")
|
||||
flag.Parse()
|
||||
|
||||
var t terminalapi.Terminal
|
||||
|
@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
// Package termbox implements terminal using the nsf/termbox-go library.
|
||||
// Prefer to use tcell instead, nsf/termbox-go is no longer maintained.
|
||||
package termbox
|
||||
|
||||
import (
|
||||
@ -52,6 +53,9 @@ func ColorMode(cm terminalapi.ColorMode) Option {
|
||||
|
||||
// Terminal provides input and output to a real terminal. Wraps the
|
||||
// nsf/termbox-go terminal implementation. This object is not thread-safe.
|
||||
//
|
||||
// Prefer to use tcell instead, nsf/termbox-go is no longer maintained.
|
||||
//
|
||||
// Implements terminalapi.Terminal.
|
||||
type Terminal struct {
|
||||
// events is a queue of input events.
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/barchart"
|
||||
)
|
||||
@ -56,7 +56,7 @@ func playBarChart(ctx context.Context, bc *barchart.BarChart, delay time.Duratio
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -25,14 +25,14 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/button"
|
||||
"github.com/mum4k/termdash/widgets/segmentdisplay"
|
||||
)
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/donut"
|
||||
)
|
||||
@ -79,7 +79,7 @@ func playDonut(ctx context.Context, d *donut.Donut, start, step int, delay time.
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/gauge"
|
||||
)
|
||||
@ -79,7 +79,7 @@ func playGauge(ctx context.Context, g *gauge.Gauge, step int, delay time.Duratio
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/linechart"
|
||||
)
|
||||
@ -74,7 +74,7 @@ func playLineChart(ctx context.Context, lc *linechart.LineChart, delay time.Dura
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/segmentdisplay"
|
||||
)
|
||||
@ -113,7 +113,7 @@ func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/mum4k/termdash/cell"
|
||||
"github.com/mum4k/termdash/container"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/terminal/terminalapi"
|
||||
"github.com/mum4k/termdash/widgets/sparkline"
|
||||
)
|
||||
@ -76,7 +76,7 @@ func fillSparkLine(ctx context.Context, sl *sparkline.SparkLine, delay time.Dura
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
"github.com/mum4k/termdash/container/grid"
|
||||
"github.com/mum4k/termdash/keyboard"
|
||||
"github.com/mum4k/termdash/linestyle"
|
||||
"github.com/mum4k/termdash/terminal/termbox"
|
||||
"github.com/mum4k/termdash/terminal/tcell"
|
||||
"github.com/mum4k/termdash/widgets/button"
|
||||
"github.com/mum4k/termdash/widgets/segmentdisplay"
|
||||
"github.com/mum4k/termdash/widgets/textinput"
|
||||
@ -110,7 +110,7 @@ func rollText(ctx context.Context, sd *segmentdisplay.SegmentDisplay, updateText
|
||||
}
|
||||
|
||||
func main() {
|
||||
t, err := termbox.New()
|
||||
t, err := tcell.New()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user