gi-gtk-3.0.31: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Calendar

Contents

Description

Calendar is a widget that displays a Gregorian calendar, one month at a time. It can be created with calendarNew.

The month and year currently displayed can be altered with calendarSelectMonth. The exact day can be selected from the displayed month using calendarSelectDay.

To place a visual marker on a particular day, use calendarMarkDay and to remove the marker, calendarUnmarkDay. Alternative, all marks can be cleared with calendarClearMarks.

The way in which the calendar itself is displayed can be altered using calendarSetDisplayOptions.

The selected date can be retrieved from a Calendar using calendarGetDate.

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.

Synopsis

Exported types

newtype Calendar Source #

Memory-managed wrapper type.

Constructors

Calendar (ManagedPtr Calendar) 
Instances
GObject Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

Methods

gobjectType :: IO GType #

HasParentTypes Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

type ParentTypes Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

type ParentTypes Calendar = Widget ': (Object ': (ImplementorIface ': (Buildable ': ([] :: [Type]))))

class (GObject o, IsDescendantOf Calendar o) => IsCalendar o Source #

Type class for types which can be safely cast to Calendar, for instance with toCalendar.

Instances
(GObject o, IsDescendantOf Calendar o) => IsCalendar o Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

toCalendar :: (MonadIO m, IsCalendar o) => o -> m Calendar Source #

Cast to Calendar, for types for which this is known to be safe. For general casts, use castTo.

noCalendar :: Maybe Calendar Source #

A convenience alias for Nothing :: Maybe Calendar.

Methods

clearMarks

calendarClearMarks Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> m () 

Remove all visual markers.

getDate

calendarGetDate Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> m (Word32, Word32, Word32) 

Obtains the selected date from a Calendar.

getDayIsMarked

calendarGetDayIsMarked Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> Word32

day: the day number between 1 and 31.

-> m Bool

Returns: whether the day is marked.

Returns if the day of the calendar is already marked.

Since: 3.0

getDetailHeightRows

calendarGetDetailHeightRows Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> m Int32

Returns: The height of detail cells, in rows.

Queries the height of detail cells, in rows. See Calendar:detail-width-chars.

Since: 2.14

getDetailWidthChars

calendarGetDetailWidthChars Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> m Int32

Returns: The width of detail cells, in characters.

Queries the width of detail cells, in characters. See Calendar:detail-width-chars.

Since: 2.14

getDisplayOptions

calendarGetDisplayOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> m [CalendarDisplayOptions]

Returns: the display options.

Returns the current display options of calendar.

Since: 2.4

markDay

calendarMarkDay Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> Word32

day: the day number to mark between 1 and 31.

-> m () 

Places a visual marker on a particular day.

new

calendarNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Calendar

Returns: a newly Calendar widget

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

selectDay

calendarSelectDay Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> Word32

day: the day number between 1 and 31, or 0 to unselect the currently selected day.

-> m () 

Selects a day from the current month.

selectMonth

calendarSelectMonth Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> Word32

month: a month number between 0 and 11.

-> Word32

year: the year the month is in.

-> m () 

Shifts the calendar to a different month.

setDetailFunc

calendarSetDetailFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> CalendarDetailFunc

func: a function providing details for each day.

-> m () 

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 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 if Calendar:show-details is not set.

The size of the details area can be restricted by setting the Calendar:detail-width-chars and Calendar:detail-height-rows properties.

Since: 2.14

setDetailHeightRows

calendarSetDetailHeightRows Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> Int32

rows: detail height in rows.

-> m () 

Updates the height of detail cells. See Calendar:detail-height-rows.

Since: 2.14

setDetailWidthChars

calendarSetDetailWidthChars Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> Int32

chars: detail width in characters.

-> m () 

Updates the width of detail cells. See Calendar:detail-width-chars.

Since: 2.14

setDisplayOptions

calendarSetDisplayOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar

-> [CalendarDisplayOptions]

flags: the display options to set

-> m () 

Sets display options (whether to display the heading and the month headings).

Since: 2.4

unmarkDay

calendarUnmarkDay Source #

Arguments

:: (HasCallStack, MonadIO m, IsCalendar a) 
=> a

calendar: a Calendar.

-> Word32

day: the day number to unmark between 1 and 31.

-> m () 

Removes the visual marker from a particular day.

Properties

day

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.

constructCalendarDay :: IsCalendar o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “day” property. This is rarely needed directly, but it is used by new.

getCalendarDay :: (MonadIO m, IsCalendar o) => o -> m Int32 Source #

Get the value of the “day” property. When overloading is enabled, this is equivalent to

get calendar #day

setCalendarDay :: (MonadIO m, IsCalendar o) => o -> Int32 -> m () Source #

Set the value of the “day” property. When overloading is enabled, this is equivalent to

set calendar [ #day := value ]

detailHeightRows

Height of a detail cell, in rows. A value of 0 allows any width. See calendarSetDetailFunc.

Since: 2.14

constructCalendarDetailHeightRows :: IsCalendar o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “detail-height-rows” property. This is rarely needed directly, but it is used by new.

getCalendarDetailHeightRows :: (MonadIO m, IsCalendar o) => o -> m Int32 Source #

Get the value of the “detail-height-rows” property. When overloading is enabled, this is equivalent to

get calendar #detailHeightRows

setCalendarDetailHeightRows :: (MonadIO m, IsCalendar o) => o -> Int32 -> m () Source #

Set the value of the “detail-height-rows” property. When overloading is enabled, this is equivalent to

set calendar [ #detailHeightRows := value ]

detailWidthChars

Width of a detail cell, in characters. A value of 0 allows any width. See calendarSetDetailFunc.

Since: 2.14

constructCalendarDetailWidthChars :: IsCalendar o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “detail-width-chars” property. This is rarely needed directly, but it is used by new.

getCalendarDetailWidthChars :: (MonadIO m, IsCalendar o) => o -> m Int32 Source #

Get the value of the “detail-width-chars” property. When overloading is enabled, this is equivalent to

get calendar #detailWidthChars

setCalendarDetailWidthChars :: (MonadIO m, IsCalendar o) => o -> Int32 -> m () Source #

Set the value of the “detail-width-chars” property. When overloading is enabled, this is equivalent to

set calendar [ #detailWidthChars := value ]

month

The selected month (as a number between 0 and 11). This property gets initially set to the current month.

constructCalendarMonth :: IsCalendar o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “month” property. This is rarely needed directly, but it is used by new.

getCalendarMonth :: (MonadIO m, IsCalendar o) => o -> m Int32 Source #

Get the value of the “month” property. When overloading is enabled, this is equivalent to

get calendar #month

setCalendarMonth :: (MonadIO m, IsCalendar o) => o -> Int32 -> m () Source #

Set the value of the “month” property. When overloading is enabled, this is equivalent to

set calendar [ #month := value ]

noMonthChange

Determines whether the selected month can be changed.

Since: 2.4

constructCalendarNoMonthChange :: IsCalendar o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “no-month-change” property. This is rarely needed directly, but it is used by new.

getCalendarNoMonthChange :: (MonadIO m, IsCalendar o) => o -> m Bool Source #

Get the value of the “no-month-change” property. When overloading is enabled, this is equivalent to

get calendar #noMonthChange

setCalendarNoMonthChange :: (MonadIO m, IsCalendar o) => o -> Bool -> m () Source #

Set the value of the “no-month-change” property. When overloading is enabled, this is equivalent to

set calendar [ #noMonthChange := value ]

showDayNames

Determines whether day names are displayed.

Since: 2.4

constructCalendarShowDayNames :: IsCalendar o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-day-names” property. This is rarely needed directly, but it is used by new.

getCalendarShowDayNames :: (MonadIO m, IsCalendar o) => o -> m Bool Source #

Get the value of the “show-day-names” property. When overloading is enabled, this is equivalent to

get calendar #showDayNames

setCalendarShowDayNames :: (MonadIO m, IsCalendar o) => o -> Bool -> m () Source #

Set the value of the “show-day-names” property. When overloading is enabled, this is equivalent to

set calendar [ #showDayNames := value ]

showDetails

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.

Since: 2.14

constructCalendarShowDetails :: IsCalendar o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-details” property. This is rarely needed directly, but it is used by new.

getCalendarShowDetails :: (MonadIO m, IsCalendar o) => o -> m Bool Source #

Get the value of the “show-details” property. When overloading is enabled, this is equivalent to

get calendar #showDetails

setCalendarShowDetails :: (MonadIO m, IsCalendar o) => o -> Bool -> m () Source #

Set the value of the “show-details” property. When overloading is enabled, this is equivalent to

set calendar [ #showDetails := value ]

showHeading

Determines whether a heading is displayed.

Since: 2.4

constructCalendarShowHeading :: IsCalendar o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-heading” property. This is rarely needed directly, but it is used by new.

getCalendarShowHeading :: (MonadIO m, IsCalendar o) => o -> m Bool Source #

Get the value of the “show-heading” property. When overloading is enabled, this is equivalent to

get calendar #showHeading

setCalendarShowHeading :: (MonadIO m, IsCalendar o) => o -> Bool -> m () Source #

Set the value of the “show-heading” property. When overloading is enabled, this is equivalent to

set calendar [ #showHeading := value ]

showWeekNumbers

Determines whether week numbers are displayed.

Since: 2.4

constructCalendarShowWeekNumbers :: IsCalendar o => Bool -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-week-numbers” property. This is rarely needed directly, but it is used by new.

getCalendarShowWeekNumbers :: (MonadIO m, IsCalendar o) => o -> m Bool Source #

Get the value of the “show-week-numbers” property. When overloading is enabled, this is equivalent to

get calendar #showWeekNumbers

setCalendarShowWeekNumbers :: (MonadIO m, IsCalendar o) => o -> Bool -> m () Source #

Set the value of the “show-week-numbers” property. When overloading is enabled, this is equivalent to

set calendar [ #showWeekNumbers := value ]

year

The selected year. This property gets initially set to the current year.

constructCalendarYear :: IsCalendar o => Int32 -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “year” property. This is rarely needed directly, but it is used by new.

getCalendarYear :: (MonadIO m, IsCalendar o) => o -> m Int32 Source #

Get the value of the “year” property. When overloading is enabled, this is equivalent to

get calendar #year

setCalendarYear :: (MonadIO m, IsCalendar o) => o -> Int32 -> m () Source #

Set the value of the “year” property. When overloading is enabled, this is equivalent to

set calendar [ #year := value ]

Signals

daySelected

type C_CalendarDaySelectedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarDaySelectedCallback = IO () Source #

Emitted when the user selects a day.

afterCalendarDaySelected :: (IsCalendar a, MonadIO m) => a -> CalendarDaySelectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “day-selected” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #daySelected callback

onCalendarDaySelected :: (IsCalendar a, MonadIO m) => a -> CalendarDaySelectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “day-selected” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #daySelected callback

daySelectedDoubleClick

type C_CalendarDaySelectedDoubleClickCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarDaySelectedDoubleClickCallback = IO () Source #

Emitted when the user double-clicks a day.

afterCalendarDaySelectedDoubleClick :: (IsCalendar a, MonadIO m) => a -> CalendarDaySelectedDoubleClickCallback -> m SignalHandlerId Source #

Connect a signal handler for the “day-selected-double-click” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #daySelectedDoubleClick callback

onCalendarDaySelectedDoubleClick :: (IsCalendar a, MonadIO m) => a -> CalendarDaySelectedDoubleClickCallback -> m SignalHandlerId Source #

Connect a signal handler for the “day-selected-double-click” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #daySelectedDoubleClick callback

monthChanged

type C_CalendarMonthChangedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarMonthChangedCallback = IO () Source #

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

afterCalendarMonthChanged :: (IsCalendar a, MonadIO m) => a -> CalendarMonthChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “month-changed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #monthChanged callback

onCalendarMonthChanged :: (IsCalendar a, MonadIO m) => a -> CalendarMonthChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “month-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #monthChanged callback

nextMonth

type C_CalendarNextMonthCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarNextMonthCallback = IO () Source #

Emitted when the user switched to the next month.

afterCalendarNextMonth :: (IsCalendar a, MonadIO m) => a -> CalendarNextMonthCallback -> m SignalHandlerId Source #

Connect a signal handler for the “next-month” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #nextMonth callback

onCalendarNextMonth :: (IsCalendar a, MonadIO m) => a -> CalendarNextMonthCallback -> m SignalHandlerId Source #

Connect a signal handler for the “next-month” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #nextMonth callback

nextYear

type C_CalendarNextYearCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarNextYearCallback = IO () Source #

Emitted when user switched to the next year.

afterCalendarNextYear :: (IsCalendar a, MonadIO m) => a -> CalendarNextYearCallback -> m SignalHandlerId Source #

Connect a signal handler for the “next-year” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #nextYear callback

onCalendarNextYear :: (IsCalendar a, MonadIO m) => a -> CalendarNextYearCallback -> m SignalHandlerId Source #

Connect a signal handler for the “next-year” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #nextYear callback

prevMonth

type C_CalendarPrevMonthCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarPrevMonthCallback = IO () Source #

Emitted when the user switched to the previous month.

afterCalendarPrevMonth :: (IsCalendar a, MonadIO m) => a -> CalendarPrevMonthCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prev-month” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #prevMonth callback

onCalendarPrevMonth :: (IsCalendar a, MonadIO m) => a -> CalendarPrevMonthCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prev-month” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #prevMonth callback

prevYear

type C_CalendarPrevYearCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CalendarPrevYearCallback = IO () Source #

Emitted when user switched to the previous year.

afterCalendarPrevYear :: (IsCalendar a, MonadIO m) => a -> CalendarPrevYearCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prev-year” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #prevYear callback

onCalendarPrevYear :: (IsCalendar a, MonadIO m) => a -> CalendarPrevYearCallback -> m SignalHandlerId Source #

Connect a signal handler for the “prev-year” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #prevYear callback