[go: up one dir, main page]

Skip to content

tvxwidgets provides extra widgets for tview

License

Notifications You must be signed in to change notification settings

Fyb3roptik/tvxwidgets

 
 

Repository files navigation

tvxwidgets

PkgGoDev Go Report

tvxwidgets provides extra widgets for tview.

Screenshot

Widgets

Example

package main

import (
	"time"

	"github.com/gdamore/tcell/v2"
	"github.com/navidys/tvxwidgets"
	"github.com/rivo/tview"
)

func main() {
	app := tview.NewApplication()
	gauge := tvxwidgets.NewActivityModeGauge()
	gauge.SetTitle("activity mode gauge")
	gauge.SetPgBgColor(tcell.ColorOrange)
	gauge.SetRect(10, 4, 50, 3)
	gauge.SetBorder(true)

	update := func() {
		tick := time.NewTicker(500 * time.Millisecond)
		for {
			select {
			case <-tick.C:
				gauge.Pulse()
				app.Draw()
			}
		}
	}
	go update()

	if err := app.SetRoot(gauge, false).EnableMouse(true).Run(); err != nil {
		panic(err)
	}
}

About

tvxwidgets provides extra widgets for tview

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 92.4%
  • Makefile 5.8%
  • Shell 1.8%