Top | ![]() |
![]() |
![]() |
![]() |
gchar * | (*GtkCalendarDetailFunc) () |
GtkWidget * | gtk_calendar_new () |
void | gtk_calendar_select_month () |
void | gtk_calendar_select_day () |
void | gtk_calendar_mark_day () |
void | gtk_calendar_unmark_day () |
gboolean | gtk_calendar_get_day_is_marked () |
void | gtk_calendar_clear_marks () |
GtkCalendarDisplayOptions | gtk_calendar_get_display_options () |
void | gtk_calendar_set_display_options () |
void | gtk_calendar_get_date () |
void | gtk_calendar_set_detail_func () |
gint | gtk_calendar_get_detail_width_chars () |
void | gtk_calendar_set_detail_width_chars () |
gint | gtk_calendar_get_detail_height_rows () |
void | gtk_calendar_set_detail_height_rows () |
GtkCalendar is a widget that displays a Gregorian 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 GtkCalendar using
gtk_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 * (*GtkCalendarDetailFunc) (GtkCalendar *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 GtkCalendar. |
|
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
GtkWidget *
gtk_calendar_new (void
);
Creates a new calendar, with the current date being selected.
void gtk_calendar_select_month (GtkCalendar *calendar
,guint month
,guint year
);
Shifts the calendar to a different month.
void gtk_calendar_select_day (GtkCalendar *calendar
,guint day
);
Selects a day from the current month.
calendar |
a GtkCalendar. |
|
day |
the day number between 1 and 31, or 0 to unselect the currently selected day. |
void gtk_calendar_mark_day (GtkCalendar *calendar
,guint day
);
Places a visual marker on a particular day.
void gtk_calendar_unmark_day (GtkCalendar *calendar
,guint day
);
Removes the visual marker from a particular day.
gboolean gtk_calendar_get_day_is_marked (GtkCalendar *calendar
,guint day
);
Returns if the day
of the calendar
is already marked.
Since: 3.0
void
gtk_calendar_clear_marks (GtkCalendar *calendar
);
Remove all visual markers.
GtkCalendarDisplayOptions
gtk_calendar_get_display_options (GtkCalendar *calendar
);
Returns the current display options of calendar
.
Since: 2.4
void gtk_calendar_set_display_options (GtkCalendar *calendar
,GtkCalendarDisplayOptions flags
);
Sets display options (whether to display the heading and the month headings).
Since: 2.4
void gtk_calendar_get_date (GtkCalendar *calendar
,guint *year
,guint *month
,guint *day
);
Obtains the selected date from a GtkCalendar.
void gtk_calendar_set_detail_func (GtkCalendar *calendar
,GtkCalendarDetailFunc 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 GtkCalendar. |
|
func |
a function providing details for each day. |
|
data |
data to pass to |
|
destroy |
a function for releasing |
Since: 2.14
gint
gtk_calendar_get_detail_width_chars (GtkCalendar *calendar
);
Queries the width of detail cells, in characters. See “detail-width-chars”.
Since: 2.14
void gtk_calendar_set_detail_width_chars (GtkCalendar *calendar
,gint chars
);
Updates the width of detail cells. See “detail-width-chars”.
Since: 2.14
gint
gtk_calendar_get_detail_height_rows (GtkCalendar *calendar
);
Queries the height of detail cells, in rows. See “detail-width-chars”.
Since: 2.14
void gtk_calendar_set_detail_height_rows (GtkCalendar *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 GtkCalendar.
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 |