Curses:...rogress(3)
π Curses::UI::Dialog::Progress β bestie's guide to progress dialogs
okay so real talk, this page is from the User Contributed Perl Documentation section of the manual, and we're about to make a progress bar make sense. i promise it's not scary.
β¨ NAME β¨
Curses::UI::Dialog::Progress β literally just: create and manipulate progress dialogs π
π¦ CLASS HIERARCHY π¦
so here's the family tree, and yes it's giving royal lineage π
Curses::UI::Widget
|
+----Curses::UI::Container
|
+----Curses::UI::Window
|
+----Curses::UI::Dialog::Progress
like, Dialog::Progress is the baby at the bottom and it inherited everything. main character energy fr.
πΈ SYNOPSIS πΈ
here's the whole vibe, copy-paste style:
use Curses::UI;
my $cui = new Curses::UI;
my $win = $cui->add('window_id', 'Window');
# The hard way.
# -------------
my $dialog = $win->add(
'mydialog', 'Dialog::Progress',
-max => 100,
-message => 'Some message',
);
$dialog->pos(10);
$dialog->message('Some other message');
$dialog->draw();
$win->delete('mydialog');
# The easy way (see Curses::UI documentation).
# --------------------------------------------
$cui->progress(
-max => 100,
-message => 'Some message',
);
$cui->setprogress(10, 'Some other message');
$cui->noprogress;
so there's the hard way (you build the dialog yourself, you draw it, you delete it β very DIY, very "i did my own nails" π
) and the easy way where the $cui object handles it for you. pick your fighter.
π DESCRIPTION π
lowkey the biggest plot twist: Curses::UI::Dialog::Progress is not really a dialog. the user can't interact with it at all β like, there's no buttons, no clicking, nothing. it's merely a way of presenting progress information to the user of your program. it's a vibe, not a conversation. π«Ά
also there's a short demo in the distribution at exampes/demo-Curses::UI::Dialog::Progress β go look at it, it's cute.
β OPTIONS β
okay here's where people get lost, so let's go one by one, no cap:
-title < TEXT >β sets the title of the dialog window to TEXT. that's it. that's the whole thing. slay. π-message < TEXT >β this sets the initial message shown to TEXT. important caveat bestie: it's displayed using aCurses::UI::Label, so it cannot contain any newline (\n) characters. like, zero. don't even try. π-nomessage < BOOLEAN >β if BOOLEAN is true, the dialog window will not contain a message label at all. by default-nomessagehas a false value, so the label is there unless you say otherwise.-min < VALUE >β one of the progressbar control options β¨-max < VALUE >β one of the progressbar control options β¨-pos < VALUE >β one of the progressbar control options β¨-nopercentage < BOOLEAN >β one of the progressbar control options β¨-nocenterline < BOOLEAN >β one of the progressbar control options β¨
those last five (-min,-max,-pos,-nopercentage,-nocenterline) are all the progressbar crew β they control the progressbar of the dialog, and for the full explanation you gotta seeCurses::UI::Progressbar. i'm not gonna pretend i know more than the source, iykyk.
π₯ METHODS π₯
new ( OPTIONS )β standard method πlayout ( )β standard method πdraw ( BOOLEAN )β standard method π
those three are standard methods, and Curses::UI::Container has the explanation for them. go read it, it's fine.
pos ( VALUE )β updates the position of the progressbar to SCALAR. β οΈ heads up: you have to calldrawafterwards to actually see the change. no draw, no show. πmessage ( TEXT )β updates the message of the progress dialog to TEXT. same deal: you have to calldrawto see it change. the whole thing is very "nothing happens until you hit draw" and honestly that's just how it is. π
π SEE ALSO π
go be nosy, these are the related ones:
Curses::UICurses::UI::ContainerCurses::UI::Progressbar
π AUTHOR π
copyright (c) 2001-2002 Maurice Makaay. all rights reserved. π
maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de) β email him, he's lovely probably.
this package is free software and is provided "as is" without express or implied warranty. it may be used, redistributed and/or modified under the same terms as perl itself. π«Ά
and that's the page!! this doc shipped with perl v5.42.2 and was dated 2023-07-03 β so it's a little vintage, but the vibes are timeless. bye bestie, go draw your progress bar ππ§β¨
π¦ where this page comes from
- alpine 3.24: perl-curses-ui-doc 0.9609-r3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms