progressbar

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Overview

Package progressbar provides ProgressBar, a single-line visual progress indicator with optional percentage label.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgressBar

type ProgressBar struct {
	views.Base

	Min, Max    int
	Position    int
	ShowPercent bool
	FilledChar  rune
	EmptyChar   rune
}

ProgressBar is a [Min..Max] gauge filled left-to-right.

func New

func New(bounds geom.Rect, min, max int) *ProgressBar

New constructs a ProgressBar with range [min..max].

func (*ProgressBar) Draw

func (p *ProgressBar) Draw()

Draw paints the bar.

func (*ProgressBar) GetTypeID

func (p *ProgressBar) GetTypeID() string

GetTypeID for the serial registry.

func (*ProgressBar) Reset

func (p *ProgressBar) Reset()

Reset returns the position to Min.

func (*ProgressBar) SetProgress

func (p *ProgressBar) SetProgress(v int)

SetProgress clamps v to [Min, Max] and stores it.

func (*ProgressBar) SetRange

func (p *ProgressBar) SetRange(min, max int)

SetRange installs a new (min, max), clamping the current position.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL