Calendar
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
- Constructors:
Calendar(**properties)
new() -> Gtk.Widget
Constructors
Methods
- class Calendar
-
- get_date() DateTime
Returns a
GDateTime
representing the shown year, month and the selected day.The returned date is in the local time zone.
- get_day_is_marked(day: int) bool
Returns if the
day
of thecalendar
is already marked.- Parameters:
day – the day number between 1 and 31.
- get_show_day_names() bool
Returns whether
self
is currently showing the names of the week days.This is the value of the
show_day_names
property.
- get_show_heading() bool
Returns whether
self
is currently showing the heading.This is the value of the
show_heading
property.
- get_show_week_numbers() bool
Returns whether
self
is showing week numbers right now.This is the value of the
show_week_numbers
property.
- mark_day(day: int) None
Places a visual marker on a particular day of the current month.
- Parameters:
day – the day number to mark between 1 and 31.
- select_day(date: DateTime) None
Switches to
date
’s year and month and select its day.- Parameters:
date – a
GDateTime
representing the day to select
- set_day(day: int) None
Sets the day for the selected date.
The new date must be valid. For example, setting 31 for the day when the month is February, fails.
Added in version 4.14.
- Parameters:
day – The desired day for the selected date (as a number between 1 and 31).
- set_month(month: int) None
Sets the month for the selected date.
The new date must be valid. For example, setting 1 (February) for the month when the day is 31, fails.
Added in version 4.14.
- Parameters:
month – The desired month for the selected date (as a number between 0 and 11).
- set_show_day_names(value: bool) None
Sets whether the calendar shows day names.
- Parameters:
value – Whether to show day names above the day numbers
- set_show_heading(value: bool) None
Sets whether the calendar should show a heading.
The heading contains the current year and month as well as buttons for changing both.
- Parameters:
value – Whether to show the heading in the calendar
- set_show_week_numbers(value: bool) None
Sets whether week numbers are shown in the calendar.
- Parameters:
value – whether to show week numbers on the left of the days
- set_year(year: int) None
Sets the year for the selected date.
The new date must be valid. For example, setting 2023 for the year when then the date is 2024-02-29, fails.
Added in version 4.14.
- Parameters:
year – The desired year for the selected date (within
DateTime
limits, i.e. from 0001 to 9999).
Properties
Signals
- class Calendar.signals