Gtk.Calendar¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day) |
||
r/w/en |
Details height in rows |
||
r/w/en |
Details width in characters |
||
r/w/en |
The selected month (as a number between 0 and 11) |
||
r/w/en |
If |
||
r/w/en |
If |
||
r/w/en |
If |
||
r/w/en |
If |
||
r/w/en |
If |
||
r/w/en |
The selected year |
Style Properties¶
- Inherited:
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
|
r |
Space between week headers and main area |
|
|
|
r |
Inner border space |
|
|
|
r |
Space between day headers and main area |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the user selects a day. |
|
Emitted when the user double-clicks a day. |
|
Emitted when the user clicks a button to change the selected month on a calendar. |
|
Emitted when the user switched to the next month. |
|
Emitted when user switched to the next year. |
|
Emitted when the user switched to the previous month. |
|
Emitted when user switched to the previous year. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
widget |
r |
Class Details¶
- class Gtk.Calendar(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Gtk.Calendar
is a widget that displays a Gregorian calendar, one month at a time. It can be created withGtk.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 usingGtk.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 withGtk.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
usingGtk.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.
xlib.Display
before these dates is likely to be historically incorrect.- classmethod new()[source]¶
- Returns:
a newly
Gtk.Calendar
widget- Return type:
Creates a new calendar, with the current date being selected.
- get_date()[source]¶
- Returns:
- Return type:
Obtains the selected date from a
Gtk.Calendar
.
- get_day_is_marked(day)[source]¶
- Parameters:
day (
int
) – the day number between 1 and 31.- Returns:
whether the day is marked.
- Return type:
Returns if the day of the self is already marked.
New in version 3.0.
- get_detail_height_rows()[source]¶
- Returns:
The height of detail cells, in rows.
- Return type:
Queries the height of detail cells, in rows. See
Gtk.Calendar
:detail-width-chars
.New in version 2.14.
- get_detail_width_chars()[source]¶
- Returns:
The width of detail cells, in characters.
- Return type:
Queries the width of detail cells, in characters. See
Gtk.Calendar
:detail-width-chars
.New in version 2.14.
- get_display_options()[source]¶
- Returns:
the display options.
- Return type:
Returns the current display options of self.
New in version 2.4.
- mark_day(day)[source]¶
- Parameters:
day (
int
) – the day number to mark between 1 and 31.
Places a visual marker on a particular day.
- select_day(day)[source]¶
- Parameters:
day (
int
) – the day number between 1 and 31, or 0 to unselect the currently selected day.
Selects a day from the current month.
- set_detail_func(func, *data)[source]¶
- Parameters:
func (
Gtk.CalendarDetailFunc
) – a function providing details for each day.
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
Gtk.Calendar
: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 ifGtk.Calendar
:show-details
is not set.The size of the details area can be restricted by setting the
Gtk.Calendar
:detail-width-chars
andGtk.Calendar
:detail-height-rows
properties.New in version 2.14.
- set_detail_height_rows(rows)[source]¶
- Parameters:
rows (
int
) – detail height in rows.
Updates the height of detail cells. See
Gtk.Calendar
:detail-height-rows
.New in version 2.14.
- set_detail_width_chars(chars)[source]¶
- Parameters:
chars (
int
) – detail width in characters.
Updates the width of detail cells. See
Gtk.Calendar
:detail-width-chars
.New in version 2.14.
- set_display_options(flags)[source]¶
- Parameters:
flags (
Gtk.CalendarDisplayOptions
) – the display options to set
Sets display options (whether to display the heading and the month headings).
New in version 2.4.
- unmark_day(day)[source]¶
- Parameters:
day (
int
) – the day number to unmark between 1 and 31.
Removes the visual marker from a particular day.
- do_day_selected() virtual¶
- do_day_selected_double_click() virtual¶
- do_month_changed() virtual¶
- do_next_month() virtual¶
- do_next_year() virtual¶
- do_prev_month() virtual¶
- do_prev_year() virtual¶
Signal Details¶
- Gtk.Calendar.signals.day_selected(calendar)¶
- Signal Name:
day-selected
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when the user selects a day.
- Gtk.Calendar.signals.day_selected_double_click(calendar)¶
- Signal Name:
day-selected-double-click
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when the user double-clicks a day.
- Gtk.Calendar.signals.month_changed(calendar)¶
- Signal Name:
month-changed
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when the user clicks a button to change the selected month on a calendar.
- Gtk.Calendar.signals.next_month(calendar)¶
- Signal Name:
next-month
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when the user switched to the next month.
- Gtk.Calendar.signals.next_year(calendar)¶
- Signal Name:
next-year
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when user switched to the next year.
- Gtk.Calendar.signals.prev_month(calendar)¶
- Signal Name:
prev-month
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when the user switched to the previous month.
- Gtk.Calendar.signals.prev_year(calendar)¶
- Signal Name:
prev-year
- Flags:
- Parameters:
calendar (
Gtk.Calendar
) – The object which received the signal
Emitted when user switched to the previous year.
Property Details¶
- Gtk.Calendar.props.day¶
- Name:
day
- Type:
- Default Value:
0
- Flags:
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.
- Gtk.Calendar.props.detail_height_rows¶
- Name:
detail-height-rows
- Type:
- Default Value:
0
- Flags:
Height of a detail cell, in rows. A value of 0 allows any width. See
Gtk.Calendar.set_detail_func
().New in version 2.14.
- Gtk.Calendar.props.detail_width_chars¶
- Name:
detail-width-chars
- Type:
- Default Value:
0
- Flags:
Width of a detail cell, in characters. A value of 0 allows any width. See
Gtk.Calendar.set_detail_func
().New in version 2.14.
- Gtk.Calendar.props.month¶
- Name:
month
- Type:
- Default Value:
0
- Flags:
The selected month (as a number between 0 and 11). This property gets initially set to the current month.
- Gtk.Calendar.props.no_month_change¶
- Name:
no-month-change
- Type:
- Default Value:
- Flags:
Determines whether the selected month can be changed.
New in version 2.4.
- Gtk.Calendar.props.show_day_names¶
- Name:
show-day-names
- Type:
- Default Value:
- Flags:
Determines whether day names are displayed.
New in version 2.4.
- Gtk.Calendar.props.show_details¶
- Name:
show-details
- Type:
- Default Value:
- Flags:
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.
New in version 2.14.
- Gtk.Calendar.props.show_heading¶
- Name:
show-heading
- Type:
- Default Value:
- Flags:
Determines whether a heading is displayed.
New in version 2.4.
- Gtk.Calendar.props.show_week_numbers¶
- Name:
show-week-numbers
- Type:
- Default Value:
- Flags:
Determines whether week numbers are displayed.
New in version 2.4.
- Gtk.Calendar.props.year¶
- Name:
year
- Type:
- Default Value:
0
- Flags:
The selected year. This property gets initially set to the current year.