| Top |
| gchar * | (*CtkCalendarDetailFunc) () |
| CtkWidget * | ctk_calendar_new () |
| void | ctk_calendar_select_month () |
| void | ctk_calendar_select_day () |
| void | ctk_calendar_mark_day () |
| void | ctk_calendar_unmark_day () |
| gboolean | ctk_calendar_get_day_is_marked () |
| void | ctk_calendar_clear_marks () |
| CtkCalendarDisplayOptions | ctk_calendar_get_display_options () |
| void | ctk_calendar_set_display_options () |
| void | ctk_calendar_get_date () |
| void | ctk_calendar_set_detail_func () |
| gint | ctk_calendar_get_detail_width_chars () |
| void | ctk_calendar_set_detail_width_chars () |
| gint | ctk_calendar_get_detail_height_rows () |
| void | ctk_calendar_set_detail_height_rows () |
| int | day | Read / Write |
| int | detail-height-rows | Read / Write |
| int | detail-width-chars | Read / Write |
| int | month | Read / Write |
| gboolean | no-month-change | Read / Write |
| gboolean | show-day-names | Read / Write |
| gboolean | show-details | Read / Write |
| gboolean | show-heading | Read / Write |
| gboolean | show-week-numbers | Read / Write |
| int | year | Read / Write |
| void | day-selected | Run First |
| void | day-selected-double-click | Run First |
| void | month-changed | Run First |
| void | next-month | Run First |
| void | next-year | Run First |
| void | prev-month | Run First |
| void | prev-year | Run First |
CtkCalendar is a widget that displays a Gregorian calendar, one month
at a time. It can be created with ctk_calendar_new().
The month and year currently displayed can be altered with
ctk_calendar_select_month(). The exact day can be selected from the
displayed month using ctk_calendar_select_day().
To place a visual marker on a particular day, use ctk_calendar_mark_day()
and to remove the marker, ctk_calendar_unmark_day(). Alternative, all
marks can be cleared with ctk_calendar_clear_marks().
The way in which the calendar itself is displayed can be altered using
ctk_calendar_set_display_options().
The selected date can be retrieved from a CtkCalendar using
ctk_calendar_get_date().
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.
gchar * (*CtkCalendarDetailFunc) (CtkCalendar *calendar,guint year,guint month,guint day,gpointer user_data);
This kind of functions provide Pango markup with detail information for the
specified day. Examples for such details are holidays or appointments. The
function returns NULL when no information is available.
calendar |
a CtkCalendar. |
|
year |
the year for which details are needed. |
|
month |
the month for which details are needed. |
|
day |
the day of |
|
user_data |
the data passed with |
Newly allocated string with Pango markup
with details for the specified day or NULL.
[nullable][transfer full]
Since: 2.14
CtkWidget *
ctk_calendar_new (void);
Creates a new calendar, with the current date being selected.
void ctk_calendar_select_month (CtkCalendar *calendar,guint month,guint year);
Shifts the calendar to a different month.
void ctk_calendar_select_day (CtkCalendar *calendar,guint day);
Selects a day from the current month.
calendar |
a CtkCalendar. |
|
day |
the day number between 1 and 31, or 0 to unselect the currently selected day. |
void ctk_calendar_mark_day (CtkCalendar *calendar,guint day);
Places a visual marker on a particular day.
void ctk_calendar_unmark_day (CtkCalendar *calendar,guint day);
Removes the visual marker from a particular day.
gboolean ctk_calendar_get_day_is_marked (CtkCalendar *calendar,guint day);
Returns if the day
of the calendar
is already marked.
Since: 3.0
void
ctk_calendar_clear_marks (CtkCalendar *calendar);
Remove all visual markers.
CtkCalendarDisplayOptions
ctk_calendar_get_display_options (CtkCalendar *calendar);
Returns the current display options of calendar
.
Since: 2.4
void ctk_calendar_set_display_options (CtkCalendar *calendar,CtkCalendarDisplayOptions flags);
Sets display options (whether to display the heading and the month headings).
Since: 2.4
void ctk_calendar_get_date (CtkCalendar *calendar,guint *year,guint *month,guint *day);
Obtains the selected date from a CtkCalendar.
void ctk_calendar_set_detail_func (CtkCalendar *calendar,CtkCalendarDetailFunc func,gpointer data,GDestroyNotify destroy);
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 “show-details” is set. A tooltip containing with full detail information is provided, if the entire text should not fit into the details area, or if “show-details” is not set.
The size of the details area can be restricted by setting the “detail-width-chars” and “detail-height-rows” properties.
calendar |
a CtkCalendar. |
|
func |
a function providing details for each day. |
|
data |
data to pass to |
|
destroy |
a function for releasing |
Since: 2.14
gint
ctk_calendar_get_detail_width_chars (CtkCalendar *calendar);
Queries the width of detail cells, in characters. See “detail-width-chars”.
Since: 2.14
void ctk_calendar_set_detail_width_chars (CtkCalendar *calendar,gint chars);
Updates the width of detail cells. See “detail-width-chars”.
Since: 2.14
gint
ctk_calendar_get_detail_height_rows (CtkCalendar *calendar);
Queries the height of detail cells, in rows. See “detail-width-chars”.
Since: 2.14
void ctk_calendar_set_detail_height_rows (CtkCalendar *calendar,gint rows);
Updates the height of detail cells. See “detail-height-rows”.
Since: 2.14
These options can be used to influence the display and behaviour of a CtkCalendar.
|
Specifies that the month and year should be displayed. |
||
|
Specifies that three letter day descriptions should be present. |
||
|
Prevents the user from switching months with the calendar. |
||
|
Displays each week numbers of the current year, down the left side of the calendar. |
||
|
Just show an indicator, not the full details
text when details are provided. See |
“day” property “day” int
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.
Owner: CtkCalendar
Flags: Read / Write
Allowed values: [0,31]
Default value: 0
“detail-height-rows” property “detail-height-rows” int
Height of a detail cell, in rows.
A value of 0 allows any width. See ctk_calendar_set_detail_func().
Owner: CtkCalendar
Flags: Read / Write
Allowed values: [0,127]
Default value: 0
Since: 2.14
“detail-width-chars” property “detail-width-chars” int
Width of a detail cell, in characters.
A value of 0 allows any width. See ctk_calendar_set_detail_func().
Owner: CtkCalendar
Flags: Read / Write
Allowed values: [0,127]
Default value: 0
Since: 2.14
“month” property “month” int
The selected month (as a number between 0 and 11). This property gets initially set to the current month.
Owner: CtkCalendar
Flags: Read / Write
Allowed values: [0,11]
Default value: 0
“no-month-change” property “no-month-change” gboolean
Determines whether the selected month can be changed.
Owner: CtkCalendar
Flags: Read / Write
Default value: FALSE
Since: 2.4
“show-day-names” property “show-day-names” gboolean
Determines whether day names are displayed.
Owner: CtkCalendar
Flags: Read / Write
Default value: TRUE
Since: 2.4
“show-details” property “show-details” gboolean
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.
Owner: CtkCalendar
Flags: Read / Write
Default value: TRUE
Since: 2.14
“show-heading” property “show-heading” gboolean
Determines whether a heading is displayed.
Owner: CtkCalendar
Flags: Read / Write
Default value: TRUE
Since: 2.4
“show-week-numbers” property “show-week-numbers” gboolean
Determines whether week numbers are displayed.
Owner: CtkCalendar
Flags: Read / Write
Default value: FALSE
Since: 2.4
“day-selected” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when the user selects a day.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“day-selected-double-click” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when the user double-clicks a day.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“month-changed” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when the user clicks a button to change the selected month on a calendar.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“next-month” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when the user switched to the next month.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“next-year” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when user switched to the next year.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“prev-month” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when the user switched to the previous month.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“prev-year” signalvoid user_function (CtkCalendar *calendar, gpointer user_data)
Emitted when user switched to the previous year.
calendar |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First