gi-gtk-4.0.6: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Calendar

Description

GtkCalendar is a widget that displays a Gregorian calendar, one month at a time.

A GtkCalendar can be created with calendarNew.

The date that is currently displayed can be altered with 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 selected date can be retrieved from a GtkCalendar 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.

CSS nodes

calendar.view
├── header
│   ├── button
│   ├── stack.month
│   ├── button
│   ├── button
│   ├── label.year
│   ╰── button
╰── grid
    ╰── label[.day-name][.week-number][.day-number][.other-month][.today]

GtkCalendar has a main node with name calendar. It contains a subnode called header containing the widgets for switching between years and months.

The grid subnode contains all day labels, including week numbers on the left (marked with the .week-number css class) and day names on top (marked with the .day-name css class).

Day labels that belong to the previous or next month get the .other-month style class. The label of the current day get the .today style class.

Marked day labels get the :selected state assigned.

Synopsis

Exported types

newtype Calendar Source #

Memory-managed wrapper type.

Constructors

Calendar (ManagedPtr Calendar) 

Instances

Instances details
Eq Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

GObject Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

ManagedPtrNewtype Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

Methods

toManagedPtr :: Calendar -> ManagedPtr Calendar

TypedObject Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

Methods

glibType :: IO GType

HasParentTypes Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

IsGValue (Maybe Calendar) Source #

Convert Calendar to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Calendar

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Calendar -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Calendar)

type ParentTypes Calendar Source # 
Instance details

Defined in GI.Gtk.Objects.Calendar

type ParentTypes Calendar = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

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

Instances details
(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.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, clearMarks, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, markDay, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, selectDay, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unmarkDay, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDate, getDayIsMarked, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getShowDayNames, getShowHeading, getShowWeekNumbers, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setShowDayNames, setShowHeading, setShowWeekNumbers, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

clearMarks

calendarClearMarks Source #

Arguments

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

calendar: a GtkCalendar

-> m () 

Remove all visual markers.

getDate

calendarGetDate Source #

Arguments

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

self: a GtkCalendar

-> m DateTime

Returns: the GDate representing the shown date

Returns a GDateTime representing the shown year, month and the selected day.

The returned date is in the local time zone.

getDayIsMarked

calendarGetDayIsMarked Source #

Arguments

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

calendar: a GtkCalendar

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

getShowDayNames

calendarGetShowDayNames Source #

Arguments

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

self: a GtkCalendar

-> m Bool

Returns: Whether the calendar shows day names.

Returns whether self is currently showing the names of the week days.

This is the value of the Calendar:showDayNames property.

getShowHeading

calendarGetShowHeading Source #

Arguments

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

self: a GtkCalendar

-> m Bool

Returns: Whether the calendar is showing a heading.

Returns whether self is currently showing the heading.

This is the value of the Calendar:showHeading property.

getShowWeekNumbers

calendarGetShowWeekNumbers Source #

Arguments

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

self: a GtkCalendar

-> m Bool

Returns: Whether the calendar is showing week numbers.

Returns whether self is showing week numbers right now.

This is the value of the Calendar:showWeekNumbers property.

markDay

calendarMarkDay Source #

Arguments

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

calendar: a GtkCalendar

-> 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 GtkCalendar widget

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

selectDay

calendarSelectDay Source #

Arguments

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

self: a GtkCalendar.

-> DateTime

date: a GDateTime representing the day to select

-> m () 

Switches to date's year and month and select its day.

setShowDayNames

calendarSetShowDayNames Source #

Arguments

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

self: a GtkCalendar

-> Bool

value: Whether to show day names above the day numbers

-> m () 

Sets whether the calendar shows day names.

setShowHeading

calendarSetShowHeading Source #

Arguments

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

self: a GtkCalendar

-> Bool

value: Whether to show the heading in the calendar

-> m () 

Sets whether the calendar should show a heading.

The heading contains the current year and month as well as buttons for changing both.

setShowWeekNumbers

calendarSetShowWeekNumbers Source #

Arguments

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

self: a GtkCalendar

-> Bool

value: whether to show week numbers on the left of the days

-> m () 

Sets whether week numbers are shown in the calendar.

unmarkDay

calendarUnmarkDay Source #

Arguments

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

calendar: a GtkCalendar.

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

constructCalendarDay :: (IsCalendar o, MonadIO m) => Int32 -> m (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 ]

month

The selected month (as a number between 0 and 11).

This property gets initially set to the current month.

constructCalendarMonth :: (IsCalendar o, MonadIO m) => Int32 -> m (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 ]

showDayNames

Determines whether day names are displayed.

constructCalendarShowDayNames :: (IsCalendar o, MonadIO m) => Bool -> m (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 ]

showHeading

Determines whether a heading is displayed.

constructCalendarShowHeading :: (IsCalendar o, MonadIO m) => Bool -> m (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.

constructCalendarShowWeekNumbers :: (IsCalendar o, MonadIO m) => Bool -> m (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, MonadIO m) => Int32 -> m (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 CalendarDaySelectedCallback = IO () Source #

Emitted when the user selects a day.

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

Connect a signal handler for the daySelected signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #daySelected callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

Connect a signal handler for the daySelected signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #daySelected callback

nextMonth

type CalendarNextMonthCallback = IO () Source #

Emitted when the user switched to the next month.

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

Connect a signal handler for the nextMonth signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #nextMonth callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

Connect a signal handler for the nextMonth signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #nextMonth callback

nextYear

type CalendarNextYearCallback = IO () Source #

Emitted when user switched to the next year.

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

Connect a signal handler for the nextYear signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #nextYear callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

Connect a signal handler for the nextYear signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #nextYear callback

prevMonth

type CalendarPrevMonthCallback = IO () Source #

Emitted when the user switched to the previous month.

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

Connect a signal handler for the prevMonth signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #prevMonth callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

Connect a signal handler for the prevMonth signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #prevMonth callback

prevYear

type CalendarPrevYearCallback = IO () Source #

Emitted when user switched to the previous year.

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

Connect a signal handler for the prevYear signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after calendar #prevYear callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

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

Connect a signal handler for the prevYear signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on calendar #prevYear callback