From 3314ac30f127e43d279b4e4384ee98389c4b137a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 12 May 2014 08:29:43 +1000 Subject: Move poor mans introspection into winFang.c, and use it in purkle. --- src/purkle/purkle.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'src/purkle/purkle.c') diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c index 7bd47e7..2ee4964 100644 --- a/src/purkle/purkle.c +++ b/src/purkle/purkle.c @@ -4,36 +4,20 @@ #include "winFang.h" -// TODO - This is to work around a bug in Elm entry, remove it when the bug is fixed. -// The bug is that editable entry widgets cause the app to hang on exit. -static void _on_entry_del(void *data, Evas_Object *obj, void *event_info) -{ -// winFang *me = data; - - elm_entry_editable_set(obj, EINA_FALSE); -} - static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) { winFang *me; Widget *wid; - Evas_Object *en; me = winFangAdd(parent, 30, 590, w, h, "chatter box", "purkle", world); - en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, + wid = widgetAdd(me, WT_TEXTBOX, "History is shown here", -1, -1, -1, -1); + eo_do(wid->obj, elm_obj_entry_scrollable_set(EINA_TRUE), - elm_obj_entry_editable_set(EINA_FALSE), - evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), - evas_obj_visibility_set(EINA_TRUE) + elm_obj_entry_editable_set(EINA_FALSE) ); - elm_object_text_set(en, "History is shown here"); - elm_layout_box_append(me->win, WF_BOX, en); - eo_unref(en); - wid = widgetAdd(me, ELM_OBJ_ENTRY_CLASS, "", -1, -1, -1, -1); - wid->on_del = _on_entry_del; + wid = widgetAdd(me, WT_ENTRY, "", -1, -1, -1, -1); eo_do(wid->obj, elm_obj_entry_scrollable_set(EINA_TRUE), elm_obj_entry_editable_set(EINA_TRUE) @@ -45,7 +29,7 @@ static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) } static const char *ourName = "purkle"; -int skang, _M; +static int skang, _M; int luaopen_purkle(lua_State *L) { -- cgit v1.1