evas_object_show(btn);
static void
+_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ evas_object_del(obj);
+}
+
+static void
_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *nf = data;
elm_ctxpopup_item_append(ctxpopup, "Item 3", NULL, ctxpopup_item_select_cb, NULL);
elm_ctxpopup_item_append(ctxpopup, "Item 4", NULL, ctxpopup_item_select_cb, NULL);
+ eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL);
+ evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopup_dismissed_cb, NULL);
+
evas_object_geometry_get(obj, &x, &y, &w, &h);
evas_object_move(ctxpopup, x + (w / 2), y + (h / 2));
evas_object_show(ctxpopup);
elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE);
</pre>
</li>
+
<li>Disable auto hiding.
<p>The ctxpopup can be hidden automatically when its parent is resized. The auto hide functionality is enabled by default. You can disable auto hiding by calling the <span style="font-family: Courier New,Courier,monospace">elm_ctxpopup_auto_hide_disabled_set()</span> function with <span style="font-family: Courier New,Courier,monospace">EINA_TRUE</span>:</p>
<pre class="prettyprint">
elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
</pre>
</li>
+<li>Set auto hide when rotating the display (since Tizen 3.0).
+<p>The ctxpopup is closed when you touch outside of the ctxpopup component, or rotate the display.</p>
+<p>Since Tizen 3.0, the auto hide feature is disabled when rotating a display. When the display is rotated, the ctxpopup component position must be reset.</p>
+<p>The following example shows how to set the ctxpopup component position when rotating the display:</p>
+<pre class="prettyprint">
+/* Ctxpopup position is determined with the button's position */
+
+Evas_Object *win;
+Evas_Object *button;
+Evas_Object *ctxpopup;
+
+ctxpopup = elm_ctxpopup_add(win);
+
+elm_object_signal_callback_add(ctxpopup, "elm,state,orient,*", "elm", _ctxpopup_orient_changed_cb, button);
+
+move_ctxpopup(ctxpopup, button);
+
+static void
+move_ctxpopup(Evas_Object *ctxpopup, Evas_Object *obj)
+{
+ /* Move the ctxpopup component to the button component */
+}
+
+static void
+_ctxpopup_orient_changed_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ /*
+ The ctxpopup component emits one of the following signals:
+ "elm,state,orient,0", "elm,state,orient,90", "elm,state,orient,180", "elm,state,orient,270"
+ */
+
+ move_ctxpopup(obj, data);
+}
+</pre>
+</li>
<li>
<p>Set the priority of the direction where the ctxpopup appears from with the <span style="font-family: Courier New,Courier,monospace">elm_ctxpopup_direction_priority_set()</span> function:</p>
</li>
</ul>
+
<h2 id="items">Items</h2>
<p>The ctxpopup can contain a small number of items. Each item can have a label, an icon, or both.</p>