Widget...essBar(3pm)
π NAME π
Curses::Widgets::ProgressBar β Progress Bar Widgets, bestie π
(It's from the User Contributed Perl Documentation, manual page Widget...essBar(3pm), if you were wondering where we are rn π«Ά)
β¨ MODULE VERSION β¨
$Id: ProgressBar.pm,v 1.103 2002/11/03 23:40:04 corliss Exp corliss $
π¦ SYNOPSIS π¦
use Curses::Widgets::ProgressBar;
$progress = Curses::Widgets::ProgessBar->({
CAPTION => 'Progress',
CAPTIONCOL => 'yellow',
LENGTH => 10,
VALUE => 0,
FOREGROUND => undef,
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => undef,
HORIZONTAL => 1,
X => 1,
Y => 1,
MIN => 0,
MAX => 100,
});
$progress->draw($mwh);
$progress->input(5);
See the Curses::Widgets pod for other methods.
ok so yes, ProgessBar in that first line is spelled exactly like that in the original, no cap β copy it character for character, don't go "fixing" it, that's not the vibe π
πΈ REQUIREMENTS πΈ
CursesCurses::Widgets
π DESCRIPTION π
Curses::Widgets::ProgressBar gives you simplified OO access to a Curses-based progress bar. Every single object keeps track of its own state information β main character energy, it minds its own business π
Heads up bestie: this widget is made for rendering, not for interactive input. It's giving "look at me, don't touch me" β¨
So how do you actually move the bar? Your app updates the value either by:
- Calling the
inputmethod β which adds the value you pass to the widget's current value, or - Setting the value directly through the
setFieldmethod.
That's it, that's the whole situation π«Ά
π METHODS π
π new (inherited from Curses::Widgets) π
$progress = Curses::Widgets::ProgressBar->({
CAPTION => 'Progress',
CAPTIONCOL => 'yellow',
LENGTH => 10,
VALUE => 0,
FOREGROUND => undef,
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => undef,
HORIZONTAL => 1,
X => 1,
Y => 1,
MIN => 0,
MAX => 100,
});
new instantiates a brand new Progress Bar object, slay π The only mandatory key/value pairs in the configuration hash are X and Y. Everything else? It's got a default, bestie:
Key Default Description
============================================================
CAPTION undef Caption superimposed on border
CAPTIONCOL undef Foreground colour for caption text
LENGTH 10 Number of columns for the bar
VALUE 0 Current value
FOREGROUND undef Default foreground colour
BACKGROUND undef Default blackground colour
BORDER 1 Display border around the set
BORDERCOL undef Foreground colour for border
HORIZONTAL 1 Horizontal orientation for bar
MIN 0 Low value for bar (0%)
MAX 100 High vlaue for bar (100%)
Setting the value changes the length of the bar, based on the bounds you set with MIN and MAX. And the CAPTION? It only gets rendered on the border of a horizontal progress bar. So if you flip it vertical and your caption vanishes β that's not a bug, that's just how she is π
β draw β
$progress->draw($mwh);
draw renders the progress bar in its current state. It needs a valid handle to a curses window to render itself into β give her a stage, she'll perform π
π input π
$progress->input(5);
The argument gets added to the progress bar's current value. Math, but make it cute β¨
π§ HISTORY π§
2001/07/05β First implementation
π AUTHOR/COPYRIGHT π
(c) 2001 Arthur Corliss (corliss@digitalmages.com)
and that's a wrap, bestie π«Ά This little icon was rendered by perl v5.34.0, dated 2022-06-12, straight out of Widget...essBar(3pm). Stay hydrated, read your man pages, and go forth and draw progress bars πβ¨π
π¦ where this page comes from
- debian bookworm: libcurses-widgets-perl 1.997-8
- debian trixie: libcurses-widgets-perl 1.997-8
- ubuntu noble: libcurses-widgets-perl 1.997-8
- ubuntu resolute: libcurses-widgets-perl 1.997-8
- ubuntu stonking: libcurses-widgets-perl 1.997-8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms