2 * Elementary's <b>calendar widget</b> example, demonstrates how to modify
3 * layout strings, using functions to set weekdays names and to format
4 * month and year label.
6 * See stdout/stderr for output. Compile with:
9 * gcc -g `pkg-config --cflags --libs elementary` calendar_example_02.c -o calendar_example_02
13 #include <Elementary.h>
15 # include "elementary_config.h"
21 _format_month_year(struct tm *stime)
24 /* abbreviates month and year */
25 if (!strftime(buf, sizeof(buf), "%b %y", stime)) return NULL;
30 elm_main(int argc __UNUSED__, char **argv __UNUSED__)
32 Evas_Object *win, *bg, *cal;
33 const char *weekdays[] =
35 "S", "M", "T", "W", "T", "F", "S"
38 win = elm_win_add(NULL, "calendar", ELM_WIN_BASIC);
39 elm_win_title_set(win, "Calendar Layout Formatting Example");
40 elm_win_autodel_set(win, EINA_TRUE);
43 elm_win_resize_object_add(win, bg);
44 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
47 cal = elm_calendar_add(win);
48 elm_win_resize_object_add(win, cal);
49 evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
51 elm_calendar_format_function_set(cal, _format_month_year);
52 elm_calendar_weekdays_names_set(cal, weekdays);
54 evas_object_show(cal);
56 evas_object_show(win);