gtk.calendar

Module for [Calendar] class

Types 3

#GtkCalendar is a widget that displays a Gregorian calendar, one month at a time. It can be created with [gtk.calendar.Calendar.new_].

The month and year currently displayed can be altered with [gtk.calendar.Calendar.selectMonth]. The exact day can be selected from the displayed month using [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 way in which the calendar itself is displayed can be altered using [gtk.calendar.Calendar.setDisplayOptions].

The selected date can be retrieved from a #GtkCalendar 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.

Methods
GType _gType() @property
Calendar self()Returns `this`, for use in `with` statements.
CalendarGidBuilder builder()Get builder for [gtk.calendar.Calendar] Returns: New builder object
int day() @propertyGet `day` property. Returns: The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day). This property gets initially set to the current day.
void day(int propval) @propertySet `day` property. Params: propval = The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day). This property gets initially set to the current day.
int detailHeightRows() @propertyGet `detailHeightRows` property. Returns: Height of a detail cell, in rows. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc].
void detailHeightRows(int propval) @propertySet `detailHeightRows` property. Params: propval = Height of a detail cell, in rows. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc].
int detailWidthChars() @propertyGet `detailWidthChars` property. Returns: Width of a detail cell, in characters. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc].
void detailWidthChars(int propval) @propertySet `detailWidthChars` property. Params: propval = Width of a detail cell, in characters. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc].
int month() @propertyGet `month` property. Returns: The selected month (as a number between 0 and 11). This property gets initially set to the current month.
void month(int propval) @propertySet `month` property. Params: propval = The selected month (as a number between 0 and 11). This property gets initially set to the current month.
bool noMonthChange() @propertyGet `noMonthChange` property. Returns: Determines whether the selected month can be changed.
void noMonthChange(bool propval) @propertySet `noMonthChange` property. Params: propval = Determines whether the selected month can be changed.
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 showDetails() @propertyGet `showDetails` property. Returns: Determines whether details are shown directly in the widget, or if they are available only as tooltip. When this property is set days with details are marked.
void showDetails(bool propval) @propertySet `showDetails` property. Params: propval = Determines whether details are shown directly in the widget, or if they are available only as tooltip. When this property is set days with details are ...
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.
int year() @propertyGet `year` property. Returns: The selected year. This property gets initially set to the current year.
void year(int propval) @propertySet `year` property. Params: propval = The selected year. This property gets initially set to the current year.
void clearMarks()Remove all visual markers.
void getDate(out uint year, out uint month, out uint day)Obtains the selected date from a #GtkCalendar.
bool getDayIsMarked(uint day)Returns if the day of the calendar is already marked.
int getDetailHeightRows()Queries the height of detail cells, in rows. See #GtkCalendar:detail-width-chars. Returns: The height of detail cells, in rows.
int getDetailWidthChars()Queries the width of detail cells, in characters. See #GtkCalendar:detail-width-chars. Returns: The width of detail cells, in characters.
gtk.types.CalendarDisplayOptions getDisplayOptions()Returns the current display options of calendar. Returns: the display options.
void markDay(uint day)Places a visual marker on a particular day.
void selectDay(uint day)Selects a day from the current month.
void selectMonth(uint month, uint year)Shifts the calendar to a different month.
void setDetailFunc(gtk.types.CalendarDetailFunc func)Installs a function which provides Pango markup with detail information for each day. Examples for such details are holidays or appointments. That information is shown below each day when #GtkCalen...
void setDetailHeightRows(int rows)Updates the height of detail cells. See #GtkCalendar:detail-height-rows.
void setDetailWidthChars(int chars)Updates the width of detail cells. See #GtkCalendar:detail-width-chars.
void setDisplayOptions(gtk.types.CalendarDisplayOptions flags)Sets display options (whether to display the heading and the month headings).
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 connectDaySelectedDoubleClick(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 `DaySelectedDoubleClick` signal.
gulong connectMonthChanged(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 `MonthChanged` 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.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new calendar, with the current date being selected. Returns: a newly #GtkCalendar widget
Methods
T day(int propval)Set `day` property. Params: propval = The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day). This property gets initially set to the current day. Returns: Bui...
T detailHeightRows(int propval)Set `detailHeightRows` property. Params: propval = Height of a detail cell, in rows. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc]. Returns: Builder instance for fluent c...
T detailWidthChars(int propval)Set `detailWidthChars` property. Params: propval = Width of a detail cell, in characters. A value of 0 allows any width. See [gtk.calendar.Calendar.setDetailFunc]. Returns: Builder instance for flu...
T month(int propval)Set `month` property. Params: propval = The selected month (as a number between 0 and 11). This property gets initially set to the current month. Returns: Builder instance for fluent chaining
T noMonthChange(bool propval)Set `noMonthChange` property. Params: propval = Determines whether the selected month can be changed. Returns: Builder instance for fluent chaining
T showDayNames(bool propval)Set `showDayNames` property. Params: propval = Determines whether day names are displayed. Returns: Builder instance for fluent chaining
T showDetails(bool propval)Set `showDetails` property. Params: propval = Determines whether details are shown directly in the widget, or if they are available only as tooltip. When this property is set days with details are ...
T showHeading(bool propval)Set `showHeading` property. Params: propval = Determines whether a heading is displayed. Returns: Builder instance for fluent chaining
T showWeekNumbers(bool propval)Set `showWeekNumbers` property. Params: propval = Determines whether week numbers are displayed. Returns: Builder instance for fluent chaining
T year(int propval)Set `year` property. Params: propval = The selected year. This property gets initially set to the current year. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.calendar.Calendar]

Methods