_bg_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__, const char *source __UNUSED__)
{
- evas_object_hide(data);
+ Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
+ _hide_signal_emit(data, wd->dir);
}
static void
static void
_hide(Evas_Object *obj)
{
- Widget_Data *wd = elm_widget_data_get(obj);
+ _ctxpopup_hide(NULL, NULL, obj, NULL);
+ evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
+}
+static void
+_ctxpopup_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
+ void *event_info __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->visible)) return;
evas_object_hide(wd->bg);
_scroller_size_reset(wd);
wd->visible = EINA_FALSE;
- evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
-}
-
-static void
-_ctxpopup_hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
- void *event_info __UNUSED__)
-{
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- _hide_signal_emit(obj, wd->dir);
}
static void
if (!wd) return ELM_CTXPOPUP_DIRECTION_UNKNOWN;
return wd->dir;
}
+
+EAPI void
+elm_ctxpopup_dismiss(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ _hide_signal_emit(obj, wd->dir);
+}
EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Evas_Object *obj);
/**
+ * @brief Dismiss a ctxpopup object
+ *
+ * @param obj The ctxpopup object
+ * Use this function to simulate clicking outside the ctxpopup to dismiss it.
+ * In this way, the ctxpopup will be hidden and the "clicked" signal will be
+ * emitted.
+ */
+EAPI void elm_ctxpopup_dismiss(Evas_Object *obj);
+
+/**
* @}
*/