UI::Di...hiptail(3pm)

๐Ÿ“ฆ
version 1.21 ยท 3 versions
, in ubuntu jammy, ubuntu noble

๐Ÿ’– NAME ๐Ÿ’–

UI::Dialog::Backend::Whiptail โ€” the backend for the Whiptail dialog variant, bestie. That's it, that's the whole vibe. It's a Perl manpage from the User Contributed Perl Documentation, and she's iconic.


โœจ SYNOPSIS โœจ

okay so here's how you actually use her:

use UI::Dialog::Backend::Whiptail;
my $d = new UI::Dialog::Backend::Whiptail ( backtitle => 'Demo',
                                            title => 'Default' );

$d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );

๐Ÿฆ‹ ABSTRACT ๐Ÿฆ‹

UI::Dialog::Backend::Whiptail is the UI::Dialog backend for the Whiptail dialog variant, periodt. When you're using this module through UI::Dialog or any other loader module, only the compatible methods are ever accessible โ€” that's the deal. BUT. When you use this module directly in your own application (like in the SYNOPSIS example up there), you get access to all the options and features of the real whiptail(1) application. Main character energy fr fr.


๐ŸŒธ DESCRIPTION ๐ŸŒธ

This dialog variant is literally the staple of the Debian console apt/dpkg interface. That's her legacy. ๐Ÿ’…

ngl there isn't very much interesting about this particular backend. She's very much a basic dialog variant compared to things like Xdialog and cDialog. Lowkey humble, highkey essential. It's giving "quiet one in the group who actually does everything."


๐ŸŽ€ EXPORT ๐ŸŽ€

None. Nothing. Zero. She gives you nothing and that's on purpose.


๐Ÿ’œ INHERITS ๐Ÿ’œ

UI::Dialog::Backend โ€” that's the parent, that's the blueprint, that's where she gets it from.


๐Ÿ‘‘ CONSTRUCTOR ๐Ÿ‘‘

new( @options )

๐Ÿ“ EXAMPLE

my $d = new( title => 'Default Title', backtitle => 'Backtitle',
             width => 65, height => 20, listheight => 5 );

๐Ÿ’… DESCRIPTION

This is the Class Constructor method, bestie. It accepts a list of key => value pairs and uses them as the defaults when interacting with the various widgets.

โญ RETURNS

A blessed object reference of the UI::Dialog::Backend::Whiptail class. A whole baby object, yours to raise. ๐Ÿซถ

๐ŸŒˆ OPTIONS

The (...)'s after each option show you the default for that option. An * means it's supported by all the widget methods on a per-use policy, defaulting to whatever values you decided during object creation. iykyk.

  • debug = 0,1,2 (0)
  • literal = 0,1 (0)
  • backtitle = "backtitle" ('') *
  • title = "title" ('') *
  • height = \d+ (0) *
  • listheight = \d+ (5) *
  • width = \d+ (0) *
  • beepbefore = 0,1 (0) *
  • beepafter = 0,1 (0) *

๐Ÿงš WIDGET METHODS ๐Ÿงš

yesno( )

๐Ÿ“ EXAMPLE

if ($d->yesno( text => 'A binary type question?') ) {
    # user pressed yes
} else {
    # user pressed no or cancel
}

๐Ÿ’… DESCRIPTION

Present the end user with a message box that has two buttons: yes and no. Binary. No in-between. ๐Ÿ”ฅ

โญ RETURNS

TRUE (1) for a response of YES, or FALSE (0) for anything else.


msgbox( )

๐Ÿ“ EXAMPLE

$d->msgbox( text => 'A simple message' );

๐Ÿ’… DESCRIPTION

Pesent the end user with a message box that has an OK button. (Yes, the original says "Pesent." We don't fix it, we honor it. ๐Ÿ’€)

โญ RETURNS

TRUE (1) for a response of OK, or FALSE (0) for anything else.


infobox( )

๐Ÿ“ EXAMPLE

$d->infobox( text => 'A simple 6 second message.', timeout => 6000 );

๐Ÿ’… DESCRIPTION

Pesent the end user with a message box for a limited duration of time. The timeout is specified in thousandths of a second, i.e.: 1000 = 1 second. Do the math, bestie. ๐Ÿงฎ

โญ RETURNS

TRUE (1) for a response of OK, or FALSE (0) for anything else.


password( )

๐Ÿ“ EXAMPLE

my $string = $d->password( text => 'Enter some (hidden) text.' );

๐Ÿ’… DESCRIPTION

Present the end user with a text input field that doesn't reveal the input (except to the script) plus a message. Secretive. Mysterious. Iconic. ๐Ÿ™ˆ

โญ RETURNS

A SCALAR if the response is OK, or FALSE (0) for anything else.


inputbox( )

๐Ÿ“ EXAMPLE

my $string = $d->inputbox( text => 'Enter some text.',
                           entry => 'this is the input field' );

๐Ÿ’… DESCRIPTION

Present the end user with a text input field and a message. Simple. Effective. Slay.

โญ RETURNS

A SCALAR if the response is OK, or FALSE (0) for anything else.


textbox( )

๐Ÿ“ EXAMPLE

$d->textbox( path => '/path/to/a/text/file' );

๐Ÿ’… DESCRIPTION

Present the end user with a simple scrolling box containing the contents of the given text file. Scroll away, gorgeous. ๐Ÿ“œ

โญ RETURNS

TRUE (1) if the response is OK, or FALSE (0) for anything else.


๐Ÿ“ EXAMPLE

my $selection1 = $d->menu( text => 'Select one:',
                           list => [ 'tag1', 'item1',
                                     'tag2', 'item2',
                                     'tag3', 'item3' ]
                         );

๐Ÿ’… DESCRIPTION

Present the user with a selectable list. Choose your fighter. ๐Ÿ‘‘

โญ RETURNS

A SCALAR of the chosen tag if the response is OK, or FALSE (0) for anything else.


checklist( )

๐Ÿ“ EXAMPLE

my @selection = $d->checklist( text => 'Select one:',
                               list => [ 'tag1', [ 'item1', 0 ],
                                         'tag2', [ 'item2', 1 ],
                                         'tag3', [ 'item3', 1 ] ]
                             );

๐Ÿ’… DESCRIPTION

Present the user with a selectable checklist. Multiple choices, multiple vibes. โœ…โœ…

โญ RETURNS

An ARRAY of the chosen tags if the response is OK, or FALSE (0) for anything else.


radiolist( )

๐Ÿ“ EXAMPLE

my $selection = $d->radiolist( text => 'Select one:',
                               list => [ 'tag1', [ 'item1', 0 ],
                                         'tag2', [ 'item2', 1 ],
                                         'tag3', [ 'item3', 0 ] ]
                             );

๐Ÿ’… DESCRIPTION

Present the user with a selectable radiolist. Pick ONE. Just one. Commitment. ๐ŸŽฏ

โญ RETURNS

A SCALAR of the chosen tag if the response is OK, or FALSE (0) for anything else.


fselect( )

๐Ÿ“ EXAMPLE

my $text = $d->fselect( path => '/path/to/a/file/or/directory' );

๐Ÿ’… DESCRIPTION

Present the user with a file selection widget preset with the given path. File or directory, she's flexible like that.

โญ RETURNS

A SCALAR if the response is OK, or FALSE (0) for anything else.


dselect( )

๐Ÿ“ EXAMPLE

my $text = $d->dselect( path => '/path/to/a/directory' );

๐Ÿ’… DESCRIPTION

Present the user with a file selection widget preset with the given path. Unlike fselect() this widget will only return a directory selection. Directories only. She has standards. ๐Ÿ“

โญ RETURNS

A SCALAR if the response is OK, or FALSE (0) for anything else.


gauge_start( )

๐Ÿ“ EXAMPLE

$d->gauge_start( text => 'gauge...', percentage => 1 );

๐Ÿ’… DESCRIPTION

Display a meter bar to the user. This gets the widget realized but requires the use of the other gauge_*() methods for functionality. She's started, not finished โ€” you gotta do the rest. ๐Ÿ’ช

โญ RETURNS

TRUE (1) if the widget loaded fine, or FALSE (0) for anything else.


gauge_inc( )

๐Ÿ“ EXAMPLE

$d->gauge_inc( 1 );

๐Ÿ’… DESCRIPTION

Increment the meter by the given amount. We're going UP. ๐Ÿ“ˆ

โญ RETURNS

TRUE (1) if the widget incremented fine, or FALSE (0) for anything else.


gauge_dec( )

๐Ÿ“ EXAMPLE

$d->gauge_dec( 1 );

๐Ÿ’… DESCRIPTION

Decrement the meter by the given amount. And now we're going DOWN. ๐Ÿ“‰

โญ RETURNS

TRUE (1) if the widget incremented fine, or FALSE (0) for anything else.


gauge_set( )

๐Ÿ“ EXAMPLE

$d->gauge_set( 99 );

๐Ÿ’… DESCRIPTION

Set the meter bar to the given amount. Absolute control. โœ‹

โญ RETURNS

TRUE (1) if the widget set fine, or FALSE (0) for anything else.


gauge_text( )

๐Ÿ“ EXAMPLE

$d->gauge_text( 'string' );

๐Ÿ’… DESCRIPTION

Set the meter bar message to the given string. Speak your truth. ๐Ÿ’ฌ

โญ RETURNS

TRUE (1) if the widget set fine, or FALSE (0) for anything else.


gauge_stop( )

๐Ÿ“ EXAMPLE

$d->gauge_stop();

๐Ÿ’… DESCRIPTION

End the meter bar widget process. She's done. Close the curtain. ๐ŸŽฌ

โญ RETURNS

TRUE (1) if the widget closed fine, or FALSE (0) for anything else.


๐Ÿ” SEE ALSO ๐Ÿ”

PERLDOC

  • UI::Dialog
  • UI::Dialog::Console
  • UI::Dialog::Backend

MAN FILES


๐Ÿ’€ BUGS ๐Ÿ’€

Please email the author with any bug reports. Include the name of the module in the subject line. (Yes bestie, put it in the subject. They're asking nicely. ๐Ÿฅบ)


๐Ÿซถ AUTHOR ๐Ÿซถ

Kevin C. Krinke, E<lt>kevin@krinke.caE<gt>


Copyright (C) 2004-2016 Kevin C. Krinke <kevin@krinke.ca>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

โš ๏ธ okay real talk: that "WITHOUT ANY WARRANTY" bit is not a joke, bestie. No promises, no guarantees, read the license fr fr.

and that's the whole page, gorgeous. this little icon was written for perl v5.28.0 back on 2018-10-27, and it's still serving looks in the User Contributed Perl Documentation. stay slay, go build a widget, ily. ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿ’…๐Ÿซถ

๐Ÿ“ฆ where this page comes from