Widget...alendar(3pm)

πŸ“¦
version 1.997 Β· 2 versions
  • 1.997 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.997 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ—“οΈ 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 🌈

  • Curses
  • Curses::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 to undef. A caption superimposed on the border. Cute, right?
  • CAPTIONCOL β€” defaults to undef. The foreground colour for that caption text.
  • INPUTFUNC β€” defaults to \&scankey. The function used to scan for keystrokes.
  • FOREGROUND β€” defaults to undef. The default foreground colour.
  • BACKGROUND β€” defaults to undef. The default background colour.
  • BORDER β€” defaults to 1. Displays a border around the field.
  • BORDERCOL β€” defaults to undef. 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 to undef. The default highlighted data colour.
  • HEADERCOL β€” defaults to undef. The default calendar header colour.
  • MONTH β€” defaults to (current). The month to display.
  • VALUE β€” defaults to 1. The day of the month where the cursor is.
  • ONYEAR β€” defaults to undef. A callback function triggered by year.
  • ONMONTH β€” defaults to undef. A callback function triggered by month.
  • ONDAY β€” defaults to undef. 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 model
  • 2001/07/05 β€” First incarnation in OO architecture

The glow-up arc is real. 🌈


(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. πŸŽ€πŸ’–πŸ¦‹