Widget...iColumn(3pm)
π NAME π
okay bestie, gather round, because this one is Curses::Widgets::ListBox::MultiColumn β Multi-Column List Box Widgets. yes, it's a 3pm page, and yes, it's giving very much "the listbox but with columns" energy. π
πΈ MODULE VERSION πΈ
like, the actual version string, verbatim, no notes:
$Id: MultiColumn.pm,v 0.1 2002/11/14 01:28:49 corliss Exp corliss $
β¨ SYNOPSIS β¨
here's the whole vibe, copy it exactly, don't improvise:
use Curses::Widgets::ListBox::MultiColumn;
$lb = Curses::Widgets::ListBox::MultiColumn->new({
COLUMNS => [0, 5, 10, 3, 3],
LISTITEMS => [@list],
});
$lb->draw($mwh, 1);
See the Curses::Widgets pod for other methods.
heads up fr: for the rest of the methods you gotta go read the Curses::Widgets pod, that's where they live. this page is just the multi-column glow-up. π
π¦ REQUIREMENTS π¦
you need all three of these, no skipping:
CursesCurses::WidgetsCurses::Widgets::ListBox
π DESCRIPTION π
so Curses::Widgets::ListBox::MultiColumn is literally an extension of the standard Curses::Widgets::ListBox, and what it adds is the ability to have a list of columns, where each column gets its own specified width. that's it, that's the whole plot. it's the listbox but with structure. main character behaviour honestly. π
π METHODS π
π new (inherited from Curses::Widgets)
the constructor, and it looks like this:
$tm = Curses::Widgets::ListBox->new({
COLUMNS => [0, 5, 10, 3, 3],
LISTITEMS => [@list],
HEADERS => [@headers],
HEADERCOLFG => 'white',
HEADERCOLBG => 'green',
BIGHEADER => 1,
});
okay so every single key value that works for the parent class Curses::Widgets::ListBox also works here β same energy, same rules. but on top of all that, there are these brand new keys, and here they are in all their glory:
COLUMNSβ default[]β Column widthsLISTITEMSβ default[]β List of list valuesHEADERSβ default[]β Column header labelsHEADERFGCOLβ defaultundefβ Header foreground colourHEADERBGCOLβ defaultundefβ Header background colourBIGHEADERβ default0β Use more graphics for the headerKEYINDXβ default0β Index of key column
now here's a lil nuance bestie: if you define headers but you don't define one or both of the header colours, then those colours will default to the widget's fore and background. so like, no stress, it'll fall back. π«Ά
β οΈ NOTE: headers take up more lines in addition to the border β one line for the normal small header, and two lines for the larger one. you gotta factor that into your geometry when you're setting it up, fr fr. and if no labels get passed in the HEADERS array, then no space will be used for the headers at all. zero. nada. π
and about KEYINDX: right now it's only used to match keystrokes against for quick navigation. that's its whole job. it's doing its best. π
π draw
$lb->draw($mwh, 1);
the draw method renders the list box in its current state. it needs a valid handle to a curses window to render itself into β that's the $mwh situation, non-negotiable. and that optional second argument? if it's true, it'll also make the field's text cursor get rendered too. cursor said lemme show up. β¨
π§ HISTORY π§
a lil timeline for the girlies keeping track:
1999/12/29β Original list box widget in functional model2001/07/05β First incarnation in OO architecture
π AUTHOR/COPYRIGHT π
the legend herself/himself/themself:
(c) 2001 Arthur Corliss (corliss@digitalmages.com)
and that's the whole page bestie, you ate it. π
the manual name up top was Widget...iColumn, it came from the User Contributed Perl Documentation collection, and this was generated by perl v5.34.0 on 2022-06-12. slay, go write some columns. ππΈβ¨π¦π
π¦ 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