summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/examples/.gitignore1
-rw-r--r--src/examples/Makefile.am2
-rw-r--r--src/examples/naviframe_example.c48
-rw-r--r--src/lib/elc_naviframe.h3
4 files changed, 54 insertions, 0 deletions
diff --git a/src/examples/.gitignore b/src/examples/.gitignore
index 86d0dd0be..278924555 100644
--- a/src/examples/.gitignore
+++ b/src/examples/.gitignore
@@ -60,6 +60,7 @@
60/map_example_03 60/map_example_03
61/mapbuf_example 61/mapbuf_example
62/menu_example_01 62/menu_example_01
63/naviframe_example
63/notify_example_01 64/notify_example_01
64/panel_example_01 65/panel_example_01
65/panes_example 66/panes_example
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 432a57a31..07b29dee7 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -114,6 +114,7 @@ map_example_02.c \
114map_example_03.c \ 114map_example_03.c \
115mapbuf_example.c \ 115mapbuf_example.c \
116menu_example_01.c \ 116menu_example_01.c \
117naviframe_example.c \
117notify_example_01.c \ 118notify_example_01.c \
118panes_example.c \ 119panes_example.c \
119panel_example_01.c \ 120panel_example_01.c \
@@ -252,6 +253,7 @@ map_example_02 \
252map_example_03 \ 253map_example_03 \
253mapbuf_example \ 254mapbuf_example \
254menu_example_01 \ 255menu_example_01 \
256naviframe_example \
255notify_example_01 \ 257notify_example_01 \
256panes_example \ 258panes_example \
257panel_example_01 \ 259panel_example_01 \
diff --git a/src/examples/naviframe_example.c b/src/examples/naviframe_example.c
new file mode 100644
index 000000000..081fce15f
--- /dev/null
+++ b/src/examples/naviframe_example.c
@@ -0,0 +1,48 @@
1//Compile with:
2//gcc -g naviframe_example.c -o naviframe_example `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6void
7_btn_cb(void *data, Evas_Object *obj, void *event_info)
8{
9 Evas_Object *nf = data, *btn;
10 if (!nf) return;
11
12 btn = elm_button_add(nf);
13 elm_object_text_set(btn, "Go to Second Page.");
14 evas_object_smart_callback_add(btn, "clicked", _btn_cb, nf);
15
16 elm_naviframe_item_push(nf, "Next Page", NULL, NULL, btn, NULL);
17}
18
19EAPI_MAIN int
20elm_main(int argc, char **argv)
21{
22 Evas_Object *win, *nf, *btn;
23
24 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
25
26 win = elm_win_util_standard_add("naviframe", "Naviframe");
27 elm_win_autodel_set(win, EINA_TRUE);
28 evas_object_resize(win, 400, 400);
29 evas_object_show(win);
30
31 nf = elm_naviframe_add(win);
32 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33 elm_win_resize_object_add(win, nf);
34 evas_object_show(nf);
35
36 btn = elm_button_add(nf);
37 elm_object_text_set(btn, "Go to Second Page.");
38 evas_object_smart_callback_add(btn, "clicked", _btn_cb, nf);
39
40 elm_naviframe_item_push(nf, "First Page", NULL, NULL, btn, NULL);
41
42 elm_run();
43
44 elm_shutdown();
45
46 return 0;
47}
48ELM_MAIN()
diff --git a/src/lib/elc_naviframe.h b/src/lib/elc_naviframe.h
index 52171eccd..4a03cd2ab 100644
--- a/src/lib/elc_naviframe.h
+++ b/src/lib/elc_naviframe.h
@@ -73,6 +73,9 @@
73 * What happens is that the topmost item of a naviframe will be the 73 * What happens is that the topmost item of a naviframe will be the
74 * widget's target layout, when accessed directly. Items lying below 74 * widget's target layout, when accessed directly. Items lying below
75 * the top one can be interacted with this way. 75 * the top one can be interacted with this way.
76 *
77 * Here is an example on its usage:
78 * @li @ref naviframe_example
76 */ 79 */
77 80
78/** 81/**