diff options
author | David Walter Seikel | 2014-04-20 05:49:18 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-20 05:49:18 +1000 |
commit | 19c1a34f96eaac715929325683e0eeb9b333caad (patch) | |
tree | b182270b58caac85f24ccc9efa7a341d0e32c6ff | |
parent | Typo-- (diff) | |
download | SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.zip SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.gz SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.bz2 SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.xz |
Oops, had two widget structures. Merge them.
-rw-r--r-- | ClientHamr/GuiLua/GuiLua.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/ClientHamr/GuiLua/GuiLua.c b/ClientHamr/GuiLua/GuiLua.c index 9339552..cb7f64c 100644 --- a/ClientHamr/GuiLua/GuiLua.c +++ b/ClientHamr/GuiLua/GuiLua.c | |||
@@ -535,33 +535,23 @@ static void _on_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info | |||
535 | } | 535 | } |
536 | 536 | ||
537 | 537 | ||
538 | struct widget | ||
539 | { | ||
540 | Evas_Object *widget; | ||
541 | char *label, *look, *action, *help; | ||
542 | // foreground / background colour | ||
543 | // thing | ||
544 | // types {} | ||
545 | // skangCoord x, y, w, h | ||
546 | }; | ||
547 | |||
548 | /* Sooo, how to do this - | 538 | /* Sooo, how to do this - |
549 | |||
550 | widget has to be a light userdata | 539 | widget has to be a light userdata |
551 | The rest can be Lua sub things? Each with a C function to update the widget. | 540 | The rest can be Lua sub things? Each with a C function to update the widget. |
552 | 541 | ||
553 | win.quitter.look | ||
554 | |||
555 | win.quitter:colour(1,2,3,4) -> win.quitter.colour(win.quitter, 1,2,3,4) -> __call(win.quitter.colour, win.quitter, 1,2,3,4) -> skang.colour(win.quitter.colour, win.quitter, 1,2,3,4) | 542 | win.quitter:colour(1,2,3,4) -> win.quitter.colour(win.quitter, 1,2,3,4) -> __call(win.quitter.colour, win.quitter, 1,2,3,4) -> skang.colour(win.quitter.colour, win.quitter, 1,2,3,4) |
556 | win.quitter.colour.r = 5 -> direct access to the table, well "direct" via Thing and Mum. We eventually want to call skang.colour() though. | 543 | win.quitter.colour.r = 5 -> direct access to the table, well "direct" via Thing and Mum. We eventually want to call skang.colour() though. |
557 | |||
558 | */ | 544 | */ |
559 | 545 | ||
560 | struct _Widget | 546 | struct _Widget |
561 | { | 547 | { |
562 | char magic[8]; | 548 | char magic[8]; |
563 | char *action; | ||
564 | Evas_Object *obj; | 549 | Evas_Object *obj; |
550 | char *label, *look, *action, *help; | ||
551 | // foreground / background colour | ||
552 | // thing | ||
553 | // types {} | ||
554 | // skangCoord x, y, w, h | ||
565 | }; | 555 | }; |
566 | 556 | ||
567 | static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) | 557 | static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) |
@@ -603,6 +593,7 @@ static int widget(lua_State *L) | |||
603 | 593 | ||
604 | wid = calloc(1, sizeof(struct _Widget)); | 594 | wid = calloc(1, sizeof(struct _Widget)); |
605 | strcpy(wid->magic, "Widget"); | 595 | strcpy(wid->magic, "Widget"); |
596 | wid->label = strdup(title); | ||
606 | wid->obj = elm_button_add(ourGlobals->win); | 597 | wid->obj = elm_button_add(ourGlobals->win); |
607 | elm_object_text_set(wid->obj, title); | 598 | elm_object_text_set(wid->obj, title); |
608 | evas_object_smart_callback_add(wid->obj, "clicked", _on_click, L); | 599 | evas_object_smart_callback_add(wid->obj, "clicked", _on_click, L); |
@@ -717,10 +708,7 @@ static int closeWindow(lua_State *L) | |||
717 | ourGlobals = lua_touserdata(L, -1); | 708 | ourGlobals = lua_touserdata(L, -1); |
718 | lua_pop(L, 1); | 709 | lua_pop(L, 1); |
719 | 710 | ||
720 | // This causes EO to spill lots of meaningless error messages. | 711 | // Elm will delete our buttons to, and EO will bitch four times for each. |
721 | // if (bt) | ||
722 | // evas_object_del(bt); | ||
723 | |||
724 | if (ourGlobals->win) | 712 | if (ourGlobals->win) |
725 | evas_object_del(ourGlobals->win); | 713 | evas_object_del(ourGlobals->win); |
726 | 714 | ||