gtk-0.12.4: Binding to the Gtk+ graphical user interface library.

Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Safe HaskellNone

Graphics.UI.Gtk.Misc.Calendar

Contents

Description

Displays a calendar and allows the user to select a date

Synopsis

Detail

Calendar is a widget that displays a 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.

Class Hierarchy

 | GObject
 | +----Object
 | +----Widget
 | +----Calendar

Types

Constructors

calendarNew :: IO CalendarSource

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

Methods

calendarSelectMonthSource

Arguments

:: CalendarClass self 
=> self 
-> Int

month - a month number between 0 and 11.

-> Int

year - the year the month is in.

-> IO Bool

returns True, always

Shifts the calendar to a different month.

calendarSelectDaySource

Arguments

:: CalendarClass self 
=> self 
-> Int

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

-> IO () 

Selects a day from the current month.

calendarMarkDaySource

Arguments

:: CalendarClass self 
=> self 
-> Int

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

-> IO Bool

returns True, always

Places a visual marker on a particular day.

calendarUnmarkDaySource

Arguments

:: CalendarClass self 
=> self 
-> Int

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

-> IO Bool

returns True, always

Removes the visual marker from a particular day.

calendarClearMarks :: CalendarClass self => self -> IO ()Source

Remove all visual markers.

calendarDisplayOptions :: CalendarClass self => self -> [CalendarDisplayOptions] -> IO ()Source

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

calendarSetDisplayOptions :: CalendarClass self => self -> [CalendarDisplayOptions] -> IO ()Source

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

  • Available since Gtk+ version 2.4

calendarGetDisplayOptions :: CalendarClass self => self -> IO [CalendarDisplayOptions]Source

Returns the current display options for the calendar.

  • Available since Gtk+ version 2.4

calendarGetDateSource

Arguments

:: CalendarClass self 
=> self 
-> IO (Int, Int, Int)
(year, month, day)

Retrieve the currently selected date.

calendarFreezeSource

Arguments

:: CalendarClass self 
=> self 
-> IO a

An action that performs several update operations on the calendar. After the action finnishes all the changes made by it are displayed.

-> IO a 

Does nothing. Previously locked the display of the calendar for several update operations.

  • Warning: this function is deprecated and should not be used in newly-written code.

Attributes

calendarYear :: CalendarClass self => Attr self IntSource

The selected year.

Allowed values: >= 0

Default value: 0

calendarMonth :: CalendarClass self => Attr self IntSource

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

Allowed values: [0,11]

Default value: 0

calendarDay :: CalendarClass self => Attr self IntSource

The selected day (as a number between 1 and 31, or 0 to unselect the currently selected day).

Allowed values: [0,31]

Default value: 0

calendarShowHeading :: CalendarClass self => Attr self BoolSource

Determines whether a heading is displayed.

Default value: True

calendarShowDayNames :: CalendarClass self => Attr self BoolSource

Determines whether day names are displayed.

Default value: True

calendarNoMonthChange :: CalendarClass self => Attr self BoolSource

Determines whether the selected month can be changed.

Default value: False

calendarShowWeekNumbers :: CalendarClass self => Attr self BoolSource

Determines whether week numbers are displayed.

Default value: False

Signals

onDaySelected :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

'displayOptions' property. See calendarGetDisplayOptions and calendarSetDisplayOptions

calendarDisplayOptions :: CalendarClass self => Attr self [CalendarDisplayOptions] calendarDisplayOptions = newAttr calendarGetDisplayOptions calendarSetDisplayOptions

Emitted when a day was selected.

afterDaySelected :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

'displayOptions' property. See calendarGetDisplayOptions and calendarSetDisplayOptions

calendarDisplayOptions :: CalendarClass self => Attr self [CalendarDisplayOptions] calendarDisplayOptions = newAttr calendarGetDisplayOptions calendarSetDisplayOptions

Emitted when a day was selected.

onDaySelectedDoubleClick :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

Emitted when a day received a double click.

afterDaySelectedDoubleClick :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

Emitted when a day received a double click.

onMonthChanged :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The month changed.

afterMonthChanged :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The month changed.

onNextMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The next month was selected.

afterNextMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The next month was selected.

onNextYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The next year was selected.

afterNextYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The next year was selected.

onPrevMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The previous month was selected.

afterPrevMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The previous month was selected.

onPrevYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The previous year was selected.

afterPrevYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)Source

The previous year was selected.