Widget...tonSet(3pm)
π NAME π
Curses::Widgets::ButtonSet β Button Set Widgets, bestie β¨
It's giving "buttons, but make it Curses." π
πΈ MODULE VERSION πΈ
$Id: ButtonSet.pm,v 1.103 2002/11/03 23:31:26 corliss Exp corliss $
Version string in the chat, periodt. π
β¨ SYNOPSIS β¨
use Curses::Widgets::ButtonSet;
$btns = Curses::Widgets::ButtonSet->({
LENGTH => 10,
VALUE => 0,
INPUTFUNC => \&scankey,
FOREGROUND => 'white',
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => 'red',
FOCUSSWITCH => "\t\n",
HORIZONTAL => 1,
PADDING => 1,
X => 1,
Y => 1,
LABELS => [qw(OK CANCEL)],
});
$btns->draw($mwh, 1);
See the Curses::Widgets pod for other methods.
That's the whole vibe right there. π¦
π REQUIREMENTS π
CursesCurses::Widgets
You need both, no skipping, fr fr. π
π DESCRIPTION π
Curses::Widgets::ButtonSet gives you simplified OO access to Curses-based button sets. Each object maintains it's own state information. πΈ
π METHODS π
π new (inherited from Curses::Widgets)
$btns = Curses::Widgets::ButtonSet->({
LENGTH => 10,
VALUE => 0,
INPUTFUNC => \&scankey,
FOREGROUND => 'white',
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => 'red',
FOCUSSWITCH => "\t\n",
HORIZONTAL => 1,
PADDING => 1,
X => 1,
Y => 1,
LABELS => [qw(OK CANCEL)],
});
The new method instantiates a new ButtonSet object. The only mandatory key/value pairs in the configuration hash are X, Y, and LABELS. All the others have the following defaults:
Key Default Description
============================================================
LENGTH 10 Number of columns for each button label
VALUE 0 Button selected (0-based indexing)
INPUTFUNC \&scankey Function to use to scan for keystrokes
FOREGROUND undef Default foreground colour
BACKGROUND undef Default blackground colour
BORDER 1 Display border around the set
BORDERCOL undef Foreground colour for border
FOCUSSWITCH "\t\n" Characters which signify end of input
HORIZONTAL 1 Horizontal orientation for set
PADDING 1 Number of spaces between buttons
Little note, bestie: the last option, PADDING, is only applicable to horizontal sets without borders. π So don't come crying to me when it does nothing on your bordered set, iykyk.
π¦ draw
$btns->draw($mwh, 1);
The draw method renders the button set in its current state. This requires a valid handle to a curses window in which it will render itself. The optional second argument, if true, will cause the set's selected button to be rendered in standout mode (inverse video). β¨π
π HISTORY π
1999/12/29β Original button set widget in functional model2001/07/05β First incarnation in OO architecture
She's been iconic since '99, no cap. π
π«Ά AUTHOR/COPYRIGHT π«Ά
(c) 2001 Arthur Corliss (corliss@digitalmages.com)
okay so that's literally the whole thing, bestie π
This was Widget...tonSet(3pm), part of the User Contributed Perl Documentation, shipped with perl v5.34.0 and dated 2022-06-12. Love that for us. πβ¨π¦ bye bestie! ππ
π¦ 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