Calendar - Simple creation.

As a first example, let's just display a calendar in our window, explaining all steps required to do so.

First you should declare objects we intend to use:

Evas_Object *win, *cal;
Evas_Object
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185

Then a window is created, a title is set and its set to be autodeleted. More details can be found on windows examples:

win = elm_win_util_standard_add("calendar", "Calendar Creation Example");
elm_win_autodel_set(win, EINA_TRUE);
EINA_TRUE
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
elm_win_autodel_set
void elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
Set the window's autodel state.
Definition: efl_ui_win.c:6189
elm_win_util_standard_add
Evas_Object * elm_win_util_standard_add(const char *name, const char *title)
Adds a window object with standard setup.
Definition: efl_ui_win.c:9576

Next a simple background is placed on our windows. More details on elm_bg - Plain color background. :

Now, the exciting part, let's add the calendar with elm_calendar_add(), passing our window object as parent.

To conclude our example, we should show the window and run elm mainloop:

Our example will look like this:

See the full source code calendar_example_01.c here.