summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2016-07-26 10:40:42 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2016-07-26 10:40:57 +0900
commitf8aa67cd18e0f02368ca3aaedc159872feed459d (patch)
tree41093eebf90cbd06de73a1011f91a35ca3956729
parent5a7535cc4cf23f153c753c5259cc560353621f46 (diff)
downloadefl-f8aa67cd18e0f02368ca3aaedc159872feed459d.tar.gz
access: add an example of elm_object_part_access_object_get
-rw-r--r--src/examples/elementary/popup_example_04.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/examples/elementary/popup_example_04.c b/src/examples/elementary/popup_example_04.c
new file mode 100644
index 0000000000..9cff6991ee
--- /dev/null
+++ b/src/examples/elementary/popup_example_04.c
@@ -0,0 +1,61 @@
+//Compile with:
+//gcc -o popup_example_04 popup_example_04.c -g `pkg-config --cflags --libs elementary`
+
+#include <Elementary.h>
+
+static void _response_cb(void *data, Evas_Object *obj, void *event_info);
+static void _block_clicked(void *data, Evas_Object *obj, void *event_info);
+
+EAPI_MAIN int
+elm_main(int argc, char **argv)
+{
+ Evas_Object *win, *popup, *content, *btn1, *btn2;
+
+ win = elm_win_util_standard_add("popup", "Popup");
+ elm_win_autodel_set(win, EINA_TRUE);
+ elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+
+ content = elm_label_add(win);
+ elm_object_text_set(content, "<align=center>Content</align>");
+
+ popup = elm_popup_add(win);
+
+ //Setting popup content
+ elm_object_content_set(popup, content);
+ //Seting popup title-text
+ elm_object_part_text_set(popup, "title,text", "Title");
+ evas_object_show(popup);
+ evas_object_smart_callback_add(popup, "block,clicked", _block_clicked, NULL);
+
+ btn1 = elm_button_add(popup);
+ elm_object_text_set(btn1, "access on/off");
+ elm_object_part_content_set(popup, "button1", btn1);
+ evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup);
+
+ evas_object_resize(win, 480, 800);
+ evas_object_show(win);
+
+ elm_run();
+
+ return 0;
+}
+ELM_MAIN()
+
+static void
+_response_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ Evas_Object *access;
+
+ elm_config_access_set(!elm_config_access_get());
+
+ access = elm_object_part_access_object_get(data, "access.title");
+ printf("access object of popup title: %p (access mode: %d)\n", access, elm_config_access_get());
+}
+
+static void
+_block_clicked(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ evas_object_hide(obj);
+}