gtk.calendar
Module for [Calendar] class
Types 3
[gtk.calendar.Calendar] is a widget that displays a Gregorian calendar, one month at a time.
A [gtk.calendar.Calendar] can be created with [gtk.calendar.Calendar.new_].
The date that is currently displayed can be altered with [gtk.calendar.Calendar.selectDay].
To place a visual marker on a particular day, use [gtk.calendar.Calendar.markDay] and to remove the marker, [gtk.calendar.Calendar.unmarkDay]. Alternative, all marks can be cleared with [gtk.calendar.Calendar.clearMarks].
The selected date can be retrieved from a [gtk.calendar.Calendar] using [gtk.calendar.Calendar.getDate].
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.
CSS nodes
calendar.view
├── header
│ ├── button
│ ├── stack.month
│ ├── button
│ ├── button
│ ├── label.year
│ ╰── button
╰── grid
╰── label[.day-name][.week-number][.day-number][.other-month][.today][gtk.calendar.Calendar] 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.
CalendarGidBuilder builder()Get builder for [gtk.calendar.Calendar] Returns: New builder objectvoid day(int propval) @propertySet `day` property. Params: propval = The selected day (as a number between 1 and 31).int month() @propertyGet `month` property. Returns: The selected month (as a number between 0 and 11).void month(int propval) @propertySet `month` property. Params: propval = The selected month (as a number between 0 and 11).bool showDayNames() @propertyGet `showDayNames` property. Returns: Determines whether day names are displayed.void showDayNames(bool propval) @propertySet `showDayNames` property. Params: propval = Determines whether day names are displayed.bool showHeading() @propertyGet `showHeading` property. Returns: Determines whether a heading is displayed.void showHeading(bool propval) @propertySet `showHeading` property. Params: propval = Determines whether a heading is displayed.bool showWeekNumbers() @propertyGet `showWeekNumbers` property. Returns: Determines whether week numbers are displayed.void showWeekNumbers(bool propval) @propertySet `showWeekNumbers` property. Params: propval = Determines whether week numbers are displayed.void clearMarks()Remove all visual markers.glib.date_time.DateTime getDate()Returns a [glib.date_time.DateTime] representing the shown year, month and the selected day.int getDay()Gets the day of the selected date. Returns: the day of the selected date.bool getDayIsMarked(uint day)Returns if the day of the calendar is already marked.int getMonth()Gets the month of the selected date. Returns: The month of the selected date (as a number between 0 and 11).bool getShowDayNames()Returns whether self is currently showing the names of the week days.bool getShowHeading()Returns whether self is currently showing the heading.bool getShowWeekNumbers()Returns whether self is showing week numbers right now.int getYear()Gets the year of the selected date. Returns: the year of the selected date.void markDay(uint day)Places a visual marker on a particular day of the current month.void selectDay(glib.date_time.DateTime date)Switches to date's year and month and select its day.void setDay(int day)Sets the day for the selected date.void setMonth(int month)Sets the month for the selected date.void setShowDayNames(bool value)Sets whether the calendar shows day names.void setShowHeading(bool value)Sets whether the calendar should show a heading.void setShowWeekNumbers(bool value)Sets whether week numbers are shown in the calendar.void setYear(int year)Sets the year for the selected date.void unmarkDay(uint day)Removes the visual marker from a particular day.gulong connectDaySelected(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.calendar.Calendar)))
&& Parameters!T.length < 2)Connect to `DaySelected` signal.gulong connectNextMonth(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.calendar.Calendar)))
&& Parameters!T.length < 2)Connect to `NextMonth` signal.gulong connectNextYear(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.calendar.Calendar)))
&& Parameters!T.length < 2)Connect to `NextYear` signal.gulong connectPrevMonth(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.calendar.Calendar)))
&& Parameters!T.length < 2)Connect to `PrevMonth` signal.gulong connectPrevYear(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.calendar.Calendar)))
&& Parameters!T.length < 2)Connect to `PrevYear` signal.T day(int propval)Set `day` property. Params: propval = The selected day (as a number between 1 and 31). Returns: Builder instance for fluent chainingT month(int propval)Set `month` property. Params: propval = The selected month (as a number between 0 and 11).T showDayNames(bool propval)Set `showDayNames` property. Params: propval = Determines whether day names are displayed. Returns: Builder instance for fluent chainingT showHeading(bool propval)Set `showHeading` property. Params: propval = Determines whether a heading is displayed. Returns: Builder instance for fluent chainingT showWeekNumbers(bool propval)Set `showWeekNumbers` property. Params: propval = Determines whether week numbers are displayed. Returns: Builder instance for fluent chainingT year(int propval)Set `year` property. Params: propval = The selected year.