Gtk2::Calendar(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

✨ NAME ✨

Gtk2::Calendar β€” bestie, it's a wrapper for GtkCalendar πŸ’–

That's the whole vibe. It's the Perl side of the GTK+ calendar widget, and yes she does come with dates, marks, and opinions about which day of the week starts the week. πŸ—“οΈβœ¨


🌸 HIERARCHY 🌸

Like, the family tree. She did NOT come from nowhere:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gtk2::Widget
               +----Gtk2::Calendar

πŸ¦‹ INTERFACES πŸ¦‹

The interfaces she implements, periodt:

Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable

πŸ’… METHODS πŸ’…

Okay so this is the whole method menu. Every single one, no skips, no skimming, we're doing this properly. πŸ’–

  • widget = Gtk2::Calendar->new β€” constructor. Make a fresh calendar, main character energy. ✨
  • $calendar->clear_marks β€” wipes all the day marks. Clean slate, we love a reset. 🧼
  • (year, month, day) = $calendar->get_date β€” hands you back the date as a list of three. 🫢
  • $calendar->set_detail_func ($func, $data=undef) β€” sets the detail callback.
    • $func (scalar)
    • $data (scalar)
Since: gtk+ 2.14
  • integer = $calendar->get_detail_height_rows
Since: gtk+ 2.14
  • $calendar->set_detail_height_rows ($rows)
    • $rows (integer)
Since: gtk+ 2.14
  • integer = $calendar->get_detail_width_chars
Since: gtk+ 2.14
  • $calendar->set_detail_width_chars ($chars)
    • $chars (integer)
Since: gtk+ 2.14
  • $calendar->display_options ($flags) β€” ngl this is literally just the old name for set_display_options. Same girl, previous era. πŸ’€
    • $flags (Gtk2::CalendarDisplayOptions)
  • calendardisplayoptions = $calendar->get_display_options β€” getter, she's giving you the flags. 🌈
  • $calendar->set_display_options ($flags) β€” setter for the same flags.
    • $flags (Gtk2::CalendarDisplayOptions)
  • $calendar->freeze β€” freeze it. ❄️ (pair it with thaw, iykyk)
  • boolean = $calendar->mark_day ($day) β€” puts a mark on a day. πŸŽ€
    • $day (integer)
  • $widget->marked_date ($value)
  • value = $widget->marked_date
  • $widget->month ($value)
  • value = $widget->month
  • $widget->num_marked_dates ($value)
  • value = $widget->num_marked_dates
  • $calendar->select_day ($day) β€” pick a day, slay. πŸ‘‘
    • $day (integer)
  • boolean = $calendar->select_month ($month, $year) β€” pick a whole month plus year, so extra. πŸ”₯
    • $month (integer)
    • $year (integer)
  • $widget->selected_day ($value)
  • value = $widget->selected_day
  • $calendar->thaw β€” unfreeze her, she's back. β˜€οΈ
  • boolean = $calendar->unmark_day ($day) β€” remove a mark from a day.
    • $day (integer)
  • $widget->year ($value)
  • value = $widget->year

πŸŽ€ PROPERTIES πŸŽ€

All of them. Every default, every flag combo, character for character, because the details are the point. πŸ’œ

  • 'day' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day)
  • 'detail-height-rows' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” Details height in rows
  • 'detail-width-chars' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” Details width in characters
  • 'month' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” The selected month (as a number between 0 and 11)
  • 'no-month-change' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” If TRUE, the selected month cannot be changed
  • 'show-day-names' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” If TRUE, day names are displayed
  • 'show-details' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” If TRUE, details are shown
  • 'show-heading' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” If TRUE, a heading is displayed
  • 'show-week-numbers' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” If TRUE, week numbers are displayed
  • 'year' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” The selected year

🌈 STYLE PROPERTIES 🌈

These ones are readable / private, so look but don't touch, bestie. πŸ™ˆ

  • 'horizontal-separation' (integer : default 4 : readable / private / static-nick / static-blurb) β€” Space between week headers and main area
  • 'inner-border' (integer : default 4 : readable / private / static-nick / static-blurb) β€” Inner border space
  • 'vertical-separation' (integer : default 4 : readable / private / static-nick / static-blurb) β€” Space between day headers and main area

⭐ SIGNALS ⭐

The drama events, all of them:

  • day-selected (Gtk2::Calendar)
  • day-selected-double-click (Gtk2::Calendar)
  • month-changed (Gtk2::Calendar)
  • next-month (Gtk2::Calendar)
  • next-year (Gtk2::Calendar)
  • prev-month (Gtk2::Calendar)
  • prev-year (Gtk2::Calendar)

πŸ’– ENUMS AND FLAGS πŸ’–

flags Gtk2::CalendarDisplayOptions

Both names each, exactly like the source, because you'll see either one in the wild:

  • 'show-heading' / GTK_CALENDAR_SHOW_HEADING
  • 'show-day-names' / GTK_CALENDAR_SHOW_DAY_NAMES
  • 'no-month-change' / GTK_CALENDAR_NO_MONTH_CHANGE
  • 'show-week-numbers' / GTK_CALENDAR_SHOW_WEEK_NUMBERS
  • 'week-start-monday' / GTK_CALENDAR_WEEK_START_MONDAY
  • 'show-details' / GTK_CALENDAR_SHOW_DETAILS

🫢 SEE ALSO 🫢

Go read these next, fr fr:

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


Okay that's the whole page, bestie, you ate it. πŸ“ This was Gtk2::Calendar(3) from the User Contributed Perl Documentation, generated with perl v5.42.0 on 2025-07-25. Go forth and build a calendar. πŸ’…βœ¨

πŸ“¦ where this page comes from