Next: , Previous: GtkArrow, Up: Top


116 GtkCalendar

Displays a calendar and allows the user to select a date

116.1 Overview

<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.

116.2 Usage

— Class: <gtk-calendar>

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
— Signal on <gtk-calendar>: month-changed

Emitted when the user clicks a button to change the selected month on a calendar.

— Signal on <gtk-calendar>: day-selected

Emitted when the user selects a day.

— Signal on <gtk-calendar>: day-selected-double-click
— Signal on <gtk-calendar>: prev-month
— Signal on <gtk-calendar>: next-month
— Signal on <gtk-calendar>: prev-year
— Signal on <gtk-calendar>: next-year
— Function: gtk-calendar-new ⇒  (ret <gtk-widget>)

Creates a new calendar, with the current date being selected.

ret
a newly <gtk-calendar> widget
— Function: gtk-calendar-select-month (self <gtk-calendar>) (month unsigned-int) (year unsigned-int) ⇒  (ret bool)
— Method: select-month

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
— Function: gtk-calendar-select-day (self <gtk-calendar>) (day unsigned-int)
— Method: select-day

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.
— Function: gtk-calendar-mark-day (self <gtk-calendar>) (day unsigned-int) ⇒  (ret bool)
— Method: mark-day

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
— Function: gtk-calendar-unmark-day (self <gtk-calendar>) (day unsigned-int) ⇒  (ret bool)
— Method: unmark-day

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
— Function: gtk-calendar-clear-marks (self <gtk-calendar>)
— Method: clear-marks

Remove all visual markers.

calendar
a <gtk-calendar>
— Function: gtk-calendar-set-display-options (self <gtk-calendar>) (flags <gtk-calendar-display-options>)
— Method: set-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

— Function: gtk-calendar-get-date (self <gtk-calendar>) ⇒  (year unsigned-int) (month unsigned-int) (day unsigned-int)
— Method: get-date

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
— Function: gtk-calendar-freeze (self <gtk-calendar>)
— Method: freeze

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>
— Function: gtk-calendar-thaw (self <gtk-calendar>)
— Method: thaw

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>