Displays a calendar and allows the user to select a date
<gtk-calendar>
is a widget that displays a calendar, one month at a time.
It can be created with gtk-calendar-new
.
The month and year currently displayed can be altered with
gtk-calendar-select-month
. The exact day can be selected from the
displayed month using gtk-calendar-select-day
.
To place a visual marker on a particular day, use gtk-calendar-mark-day
and to remove the marker, gtk-calendar-unmark-day
. Alternative, all marks
can be cleared with gtk-calendar-clear-marks
.
The way in which the calendar itself is displayed can be altered using
gtk-calendar-set-display-options
.
The selected date can be retrieved from a <gtk-calendar>
using
gtk-calendar-get-date
.
Derives from
<gtk-widget>
.This class defines the following slots:
year
- The selected year
month
- The selected month (as a number between 0 and 11)
day
- The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day)
show-heading
- If TRUE, a heading is displayed
show-day-names
- If TRUE, day names are displayed
no-month-change
- If TRUE, the selected month cannot be changed
show-week-numbers
- If TRUE, week numbers are displayed
Emitted when the user clicks a button to change the selected month on a calendar.
<gtk-widget>
)Creates a new calendar, with the current date being selected.
- ret
- a newly
<gtk-calendar>
widget
<gtk-calendar>
) (month unsigned-int
) (year unsigned-int
) ⇒ (ret bool
)Shifts the calendar to a different month.
- calendar
- a
<gtk-calendar>
- month
- a month number between 0 and 11.
- year
- the year the month is in.
- ret
- ‘
#t
’, always
<gtk-calendar>
) (day unsigned-int
)Selects a day from the current month.
- calendar
- a
<gtk-calendar>
.- day
- the day number between 1 and 31, or 0 to unselect the currently selected day.
<gtk-calendar>
) (day unsigned-int
) ⇒ (ret bool
)Places a visual marker on a particular day.
- calendar
- a
<gtk-calendar>
- day
- the day number to mark between 1 and 31.
- ret
- ‘
#t
’, always
<gtk-calendar>
) (day unsigned-int
) ⇒ (ret bool
)Removes the visual marker from a particular day.
- calendar
- a
<gtk-calendar>
.- day
- the day number to unmark between 1 and 31.
- ret
- ‘
#t
’, always
<gtk-calendar>
)Remove all visual markers.
- calendar
- a
<gtk-calendar>
<gtk-calendar>
) (flags <gtk-calendar-display-options>
)Sets display options (whether to display the heading and the month headings).
- calendar
- a
<gtk-calendar>
- flags
- the display options to set
Since 2.4
<gtk-calendar>
) ⇒ (year unsigned-int
) (month unsigned-int
) (day unsigned-int
)Obtains the selected date from a
<gtk-calendar>
.
- calendar
- a
<gtk-calendar>
- year
- location to store the year number, or ‘
#f
’- month
- location to store the month number (between 0 and 11), or ‘
#f
’- day
- location to store the day number (between 1 and 31), or ‘
#f
’
<gtk-calendar>
)‘gtk_calendar_freeze’ has been deprecated since version 2.8 and should not be used in newly-written code.
Does nothing. Previously locked the display of the calendar until it was thawed with
gtk-calendar-thaw
.
- calendar
- a
<gtk-calendar>
<gtk-calendar>
)‘gtk_calendar_thaw’ has been deprecated since version 2.8 and should not be used in newly-written code.
Does nothing. Previously defrosted a calendar; all the changes made since the last
gtk-calendar-freeze
were displayed.
- calendar
- a
<gtk-calendar>