diff options
author | David Walter Seikel | 2014-05-12 08:29:43 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-12 08:29:43 +1000 |
commit | 3314ac30f127e43d279b4e4384ee98389c4b137a (patch) | |
tree | 00b2ff8471dc33a745036857dc8da47716e6ec6c /src/purkle | |
parent | widgetAdd now does the box / grid decision, and some oter things moved into it. (diff) | |
download | SledjHamr-3314ac30f127e43d279b4e4384ee98389c4b137a.zip SledjHamr-3314ac30f127e43d279b4e4384ee98389c4b137a.tar.gz SledjHamr-3314ac30f127e43d279b4e4384ee98389c4b137a.tar.bz2 SledjHamr-3314ac30f127e43d279b4e4384ee98389c4b137a.tar.xz |
Move poor mans introspection into winFang.c, and use it in purkle.
Diffstat (limited to 'src/purkle')
-rw-r--r-- | src/purkle/purkle.c | 26 |
1 files changed, 5 insertions, 21 deletions
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 @@ | |||
4 | #include "winFang.h" | 4 | #include "winFang.h" |
5 | 5 | ||
6 | 6 | ||
7 | // TODO - This is to work around a bug in Elm entry, remove it when the bug is fixed. | ||
8 | // The bug is that editable entry widgets cause the app to hang on exit. | ||
9 | static void _on_entry_del(void *data, Evas_Object *obj, void *event_info) | ||
10 | { | ||
11 | // winFang *me = data; | ||
12 | |||
13 | elm_entry_editable_set(obj, EINA_FALSE); | ||
14 | } | ||
15 | |||
16 | static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) | 7 | static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) |
17 | { | 8 | { |
18 | winFang *me; | 9 | winFang *me; |
19 | Widget *wid; | 10 | Widget *wid; |
20 | Evas_Object *en; | ||
21 | 11 | ||
22 | me = winFangAdd(parent, 30, 590, w, h, "chatter box", "purkle", world); | 12 | me = winFangAdd(parent, 30, 590, w, h, "chatter box", "purkle", world); |
23 | 13 | ||
24 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, | 14 | wid = widgetAdd(me, WT_TEXTBOX, "History is shown here", -1, -1, -1, -1); |
15 | eo_do(wid->obj, | ||
25 | elm_obj_entry_scrollable_set(EINA_TRUE), | 16 | elm_obj_entry_scrollable_set(EINA_TRUE), |
26 | elm_obj_entry_editable_set(EINA_FALSE), | 17 | elm_obj_entry_editable_set(EINA_FALSE) |
27 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | ||
28 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | ||
29 | evas_obj_visibility_set(EINA_TRUE) | ||
30 | ); | 18 | ); |
31 | elm_object_text_set(en, "History is shown here"); | ||
32 | elm_layout_box_append(me->win, WF_BOX, en); | ||
33 | eo_unref(en); | ||
34 | 19 | ||
35 | wid = widgetAdd(me, ELM_OBJ_ENTRY_CLASS, "", -1, -1, -1, -1); | 20 | wid = widgetAdd(me, WT_ENTRY, "", -1, -1, -1, -1); |
36 | wid->on_del = _on_entry_del; | ||
37 | eo_do(wid->obj, | 21 | eo_do(wid->obj, |
38 | elm_obj_entry_scrollable_set(EINA_TRUE), | 22 | elm_obj_entry_scrollable_set(EINA_TRUE), |
39 | elm_obj_entry_editable_set(EINA_TRUE) | 23 | elm_obj_entry_editable_set(EINA_TRUE) |
@@ -45,7 +29,7 @@ static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) | |||
45 | } | 29 | } |
46 | 30 | ||
47 | static const char *ourName = "purkle"; | 31 | static const char *ourName = "purkle"; |
48 | int skang, _M; | 32 | static int skang, _M; |
49 | 33 | ||
50 | int luaopen_purkle(lua_State *L) | 34 | int luaopen_purkle(lua_State *L) |
51 | { | 35 | { |