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() static nothrowGet builder for [gtk.calendar.Calendar] Returns: New builder objectint day() @property nothrowGet `day` property. Returns: The selected day (as a number between 1 and 31).void day(int propval) @property nothrowSet `day` property. Params: propval = The selected day (as a number between 1 and 31).int month() @property nothrowGet `month` property. Returns: The selected month (as a number between 0 and 11).void month(int propval) @property nothrowSet `month` property. Params: propval = The selected month (as a number between 0 and 11).bool showDayNames() @property nothrowGet `showDayNames` property. Returns: Determines whether day names are displayed.void showDayNames(bool propval) @property nothrowSet `showDayNames` property. Params: propval = Determines whether day names are displayed.bool showHeading() @property nothrowGet `showHeading` property. Returns: Determines whether a heading is displayed.void showHeading(bool propval) @property nothrowSet `showHeading` property. Params: propval = Determines whether a heading is displayed.bool showWeekNumbers() @property nothrowGet `showWeekNumbers` property. Returns: Determines whether week numbers are displayed.void showWeekNumbers(bool propval) @property nothrowSet `showWeekNumbers` property. Params: propval = Determines whether week numbers are displayed.glib.date_time.DateTime getDate() nothrowReturns a [glib.date_time.DateTime] representing the shown year, month and the selected day.int getMonth() nothrowGets the month of the selected date. Returns: The month of the selected date (as a number between 0 and 11).void selectDay(glib.date_time.DateTime date) nothrowSwitches to date's year and month and select its 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect to `PrevYear` signal.Fluent builder implementation template for gtk.calendar.Calendar
T day(int propval) nothrowSet `day` property. Params: propval = The selected day (as a number between 1 and 31). Returns: Builder instance for fluent chainingT month(int propval) nothrowSet `month` property. Params: propval = The selected month (as a number between 0 and 11).T showDayNames(bool propval) nothrowSet `showDayNames` property. Params: propval = Determines whether day names are displayed. Returns: Builder instance for fluent chainingT showHeading(bool propval) nothrowSet `showHeading` property. Params: propval = Determines whether a heading is displayed. Returns: Builder instance for fluent chainingT showWeekNumbers(bool propval) nothrowSet `showWeekNumbers` property. Params: propval = Determines whether week numbers are displayed. Returns: Builder instance for fluent chainingFluent builder for gtk.calendar.Calendar