It derives from <GtkWidget>.
Displays a Gregorian calendar, one month at a time.
A <GtkCalendar> can be created with
calendar:new.
The selected date can be retrieved from a
<GtkCalendar> using calendar:get-date. It can be altered with
calendar:set-date.
To place a visual marker on a particular day, use calendar:mark-day and to remove the marker,
calendar:unmark-day. Alternative, all
marks can be cleared with calendar:clear-marks.
Users should be aware that, although the Gregorian calendar is the legal calendar in most countries, it was adopted progressively between 1582 and 1929. Display before these dates is likely to be historically incorrect.
<GtkCalendar> supports the following gestures:
calendar.view
├── header
│ ├── button
│ ├── stack.month
│ ├── button
│ ├── button
│ ├── label.year
│ ╰── button
╰── grid
╰── label[.day-name][.week-number][.day-number][.other-month][.today]
<GtkCalendar> has a main node with name calendar.
It contains a subnode called header containing the widgets for switching
between years and months.
The grid subnode contains all day labels, including week numbers on the left (marked with the .week-number css class) and day names on top (marked with the .day-name css class).
Day labels that belong to the previous or next month get the .other-month style class. The label of the current day get the .today style class.
Marked day labels get the :selected state assigned.
The selected date.
This property gets initially set to the current date.
Its value is a <GDateTime>, or #f.
Set it with (set! (calendar:date self) value).
The selected day (as a number between 1 and 31).
Its value is a 32-bit integer.
Set it with (set! (calendar:day self) value).
The selected month (as a number between 0 and 11).
This property gets initially set to the current month.
Its value is a 32-bit integer.
Set it with (set! (calendar:month self) value).
Determines whether day names are displayed.
Its value is a boolean.
Set it with (set! (calendar:show-day-names self) value).
Determines whether a heading is displayed.
Its value is a boolean.
Set it with (set! (calendar:show-heading self) value).
Determines whether week numbers are displayed.
Its value is a boolean.
Set it with (set! (calendar:show-week-numbers self) value).
The selected year.
This property gets initially set to the current year.
Its value is a 32-bit integer.
Set it with (set! (calendar:year self) value).
Remove all visual markers.
Passed: a <GtkCalendar>.
Returns a <GDateTime> representing the shown
year, month and the selected day.
The returned date is in the local time zone.
Passed: a <GtkCalendar>.
Returned: a <GDateTime>.
the <GDateTime> representing the selected
date
Gets the day of the selected date.
Passed: a <GtkCalendar>.
Returned: a 32-bit integer.
the day of the selected date.
Returns if the day of the self is already marked.
Passed: a <GtkCalendar>.
Passed: an unsigned 32-bit integer.
the day number between 1 and 31.
Returned: a boolean.
whether the day is marked.
Gets the month of the selected date.
Passed: a <GtkCalendar>.
Returned: a 32-bit integer.
The month of the selected date (as a number between 0 and 11).
Returns whether self is currently showing the names of the week days.
This is the value of the calendar:show-day-names property.
Passed: a <GtkCalendar>.
Returned: a boolean.
Whether the calendar shows day names.
Returns whether self is currently showing the heading.
This is the value of the calendar:show-heading property.
Passed: a <GtkCalendar>.
Returned: a boolean.
Whether the calendar is showing a heading.
Returns whether self is showing week numbers right now.
This is the value of the calendar:show-week-numbers property.
Passed: a <GtkCalendar>.
Returned: a boolean.
Whether the calendar is showing week numbers.
Gets the year of the selected date.
Passed: a <GtkCalendar>.
Returned: a 32-bit integer.
the year of the selected date.
Places a visual marker on a particular day of the current month.
Passed: a <GtkCalendar>.
Passed: an unsigned 32-bit integer.
the day number to mark between 1 and 31.
Creates a new calendar, with the current date being selected.
Returned: a <GtkWidget>.
a newly <GtkCalendar> widget
Switches to date’s year and month and select its day.
Passed: a <GtkCalendar>.
Passed: a <GDateTime>.
a <GDateTime> representing the day to select
Switches to date’s year and month and selects its day.
Passed: a <GtkCalendar>.
Passed: a <GDateTime>.
a <GDateTime> representing the day to select
Sets the day for the selected date.
The new date must be valid. For example, setting the day to 31 when the month is February will fail.
Passed: a <GtkCalendar>.
Passed: a 32-bit integer.
The desired day for the selected date (as a number between 1 and 31).
Sets the month for the selected date.
The new date must be valid. For example, setting the month to 1 (February) when the day is 31 will fail.
Passed: a <GtkCalendar>.
Passed: a 32-bit integer.
The desired month for the selected date (as a number between 0 and 11).
Sets whether the calendar shows day names.
Passed: a <GtkCalendar>.
Passed: a boolean.
Whether to show day names above the day numbers
Sets whether the calendar should show a heading.
The heading contains the current year and month as well as buttons for changing both.
Passed: a <GtkCalendar>.
Passed: a boolean.
Whether to show the heading in the calendar
Sets whether week numbers are shown in the calendar.
Passed: a <GtkCalendar>.
Passed: a boolean.
whether to show week numbers alongside the days
Sets the year for the selected date.
The new date must be valid. For example, setting the year to 2023 when the date is February 29 will fail.
Passed: a <GtkCalendar>.
Passed: a 32-bit integer.
The desired year for the selected date (within
<GDateTime> limits, i.e. from 0001 to
9999).
Removes the visual marker from a particular day.
Passed: a <GtkCalendar>.
Passed: an unsigned 32-bit integer.
the day number to unmark between 1 and 31.
Connect a handler with (connect object calendar:day-selected
handler). It is called as (handler self).
Emitted when the user selects a day.
Passed: a <GtkCalendar>.
Connect a handler with (connect object calendar:next-month
handler). It is called as (handler self).
Emitted when the user switches to the next month.
Passed: a <GtkCalendar>.
Connect a handler with (connect object calendar:next-year
handler). It is called as (handler self).
Emitted when user switches to the next year.
Passed: a <GtkCalendar>.
Connect a handler with (connect object calendar:prev-month
handler). It is called as (handler self).
Emitted when the user switches to the previous month.
Passed: a <GtkCalendar>.
Connect a handler with (connect object calendar:prev-year
handler). It is called as (handler self).
Emitted when user switches to the previous year.
Passed: a <GtkCalendar>.