# IupCalendar

Definition: | include pGUI.e Ihandle ih = IupCalendar([[nullable_string action=NULL,] cbfunc func=NULL,] string attributes="", dword_seq args={})
Description: | Creates a month calendar interface element, where the user can select a date. GTK and Windows only. NOT available in Motif, or p2js. action: name of the action generated when the value is changed. It can be NULL(/omitted), which is replaced with VALUECHANGED_CB. func: a callback address, usually specified as Icallback("name"). For more information on the attributes and args parameters see IupSetAttributes. This is a paranormalised function. Returns: the identifier of the created element.
pwa/p2js: | Not supported. While IupDatePick() is supported via a simple HTML5 `<input type="date"/>`, and the drop-down that displays when clicked would be perfect for an IupCalendar control, there does not seem to be any way said drop-down can be statically displayed. Alternative hand crafted replacements ranged from 750 to 4,500 loc (!!) hence given that an IupDatePick is just as usable as an IupCalendar, the only sensible choice is to wait and see whether/what HTML6 delivers.
See Also: | IupDatePick
Notes: | In Windows, the view is changed when the month or year is clicked, so the user can select the month of the year or a year among years. In GTK today’ date is not marked in the calendar.
Attributes: |
TODAY | (read-only) Returns the date corresponding to today in VALUE format.
VALUE | the current date always in the format year/month/day. Can be set to "TODAY". Default value is today’ date.
WEEKNUMBERS | Shows the number of the week along the year. Default: NO.
Callbacks: |
VALUECHANGED_CB | Called after the value was interactively changed by the user. function valuechanged_cb(Ihandle ih) ih: identifier of the element that activated the event.
also | MAP_CB, UNMAP_CB, DESTROY_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB: All common callbacks are supported.
Examples: | From demo\pGUI\IupCalendar.exw The IupCalendar() is right and centre, a more discreet IupDatePick() is tucked away lower left.