From 7b48f5386fdc01fcd900bfc87ad15ac0f9e3258c Mon Sep 17 00:00:00 2001 From: Michael BOUCHAUD Date: Tue, 7 Feb 2012 23:39:19 +0000 Subject: [PATCH] elementary: add hooks text to elm_win, from Davide Andreoli. Thanks! SVN revision: 67743 --- src/lib/elm_win.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 3f32ef2..638b1d5 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -2765,6 +2765,25 @@ _elm_inwin_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas } static void +_elm_inwin_text_set_hook(Evas_Object *obj, const char *item, const char *text) +{ + Widget_Data *wd = elm_widget_data_get(obj); + + if (!wd || !item) return; + edje_object_part_text_set(wd->frm, item, text); + _sizing_eval(obj); +} + +static const char * +_elm_inwin_text_get_hook(const Evas_Object *obj, const char *item) +{ + Widget_Data *wd = elm_widget_data_get(obj); + + if (!item || !wd || !wd->frm) return NULL; + return edje_object_part_text_get(wd->frm, item); +} + +static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -2819,6 +2838,8 @@ elm_win_inwin_add(Evas_Object *obj) elm_widget_del_hook_set(obj2, _del_hook); elm_widget_theme_hook_set(obj2, _theme_hook); elm_widget_focus_next_hook_set(obj2, _elm_inwin_focus_next_hook); + elm_widget_text_set_hook_set(obj2, _elm_inwin_text_set_hook); + elm_widget_text_get_hook_set(obj2, _elm_inwin_text_get_hook); elm_widget_can_focus_set(obj2, EINA_TRUE); elm_widget_highlight_ignore_set(obj2, EINA_TRUE); -- 2.7.4