Widget...alendar(3pm)
ποΈ NAME
Curses::Widgets::Calendar β Calendar Widgets, bestie!! π This is the one and only manual page Widget...alendar(3pm) from the User Contributed Perl Documentation, and it's literally about making calendars happen inside Curses. No cap.
β¨ MODULE VERSION β¨
$Id: Calendar.pm,v 1.103 2002/11/03 23:33:05 corliss Exp corliss $
That's the exact version string, don't come for me. π
π SYNOPSIS π
use Curses::Widgets::Calendar;
$cal = Curses::Widgets::Calendar->({
CAPTION => 'Appointments',
CAPTIONCOL => 'yellow',
INPUTFUNC => \&scankey,
FOREGROUND => undef,
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => 'red',
FOCUSSWITCH => "\t",
X => 1,
Y => 1,
HIGHLIGHT => [12, 17, 25],
HIGHLIGHTCOL=> 'green',
MONTH => '11/2001',
ONYEAR => \&yearly,
ONMONTH => \&monthly,
ONDAY => \&daily,
});
$cal->draw($mwh, 1);
See the Curses::Widgets pod for other methods. There's more where that came from, iykyk. π¦
π REQUIREMENTS π
CursesCurses::Widgets
Both. You need both. It's giving "bring your own curses". π
πΈ DESCRIPTION πΈ
Curses::Widgets::Calendar gives you simplified OO access to Curses-based calendars. And the best part? Each object maintains its own state information β so your calendar is your calendar, main character energy only. β¨
π METHODS π
π«Ά new (inherited from Curses::Widgets)
$cal = Curses::Widgets::Calendar->({
CAPTION => 'Appointments',
CAPTIONCOL => 'yellow',
INPUTFUNC => \&scankey,
FOREGROUND => undef,
BACKGROUND => 'black',
BORDER => 1,
BORDERCOL => 'red',
FOCUSSWITCH => "\t",
X => 1,
Y => 1,
HIGHLIGHT => [12, 17, 25],
HIGHLIGHTCOL=> 'green',
MONTH => '11/2001',
ONYEAR => \&yearly,
ONMONTH => \&monthly,
ONDAY => \&daily,
});
The new method instantiates a brand new Calendar object. π And listen β the only mandatory key/value pairs in that config hash are X and Y. Everything else is optional and has these defaults:
CAPTIONβ defaults toundef. A caption superimposed on the border. Cute, right?CAPTIONCOLβ defaults toundef. The foreground colour for that caption text.INPUTFUNCβ defaults to\&scankey. The function used to scan for keystrokes.FOREGROUNDβ defaults toundef. The default foreground colour.BACKGROUNDβ defaults toundef. The default background colour.BORDERβ defaults to1. Displays a border around the field.BORDERCOLβ defaults toundef. The foreground colour for that border.FOCUSSWITCHβ defaults to"\t". The characters which signify end of input.HIGHLIGHTβ defaults to[]. The days to highlight.HIGHLIGHTCOLβ defaults toundef. The default highlighted data colour.HEADERCOLβ defaults toundef. The default calendar header colour.MONTHβ defaults to(current). The month to display.VALUEβ defaults to1. The day of the month where the cursor is.ONYEARβ defaults toundef. A callback function triggered by year.ONMONTHβ defaults toundef. A callback function triggered by month.ONDAYβ defaults toundef. A callback function triggered by day.
Each of the ON* callback functions expects a subroutine reference that takes exactly one argument: a handle to the calendar object itself. And here's the tea β if more than one trigger gets called, they fire in the order of day, then month, and then year. Periodt. π
β draw
$cal->draw($mwh, 1);
The draw method renders the calendar in its current state. This requires a valid handle to a curses window in which it will render itself β no handle, no calendar, bestie. π
The optional second argument? If it's true, it makes the calendar's selected day render in standout mode (that's inverse video). Iconic. β¨
π HISTORY π
1999/12/29β Original calendar widget in functional model2001/07/05β First incarnation in OO architecture
The glow-up arc is real. π
π AUTHOR/COPYRIGHT π
(c) 2001 Arthur Corliss (corliss@digitalmages.com)
And that's the whole page, bestie β perl v5.34.0, dated 2022-06-12, the Widget...alendar(3pm) manual. Go forth and calendar. πππ¦
π¦ 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