aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-20 05:49:18 +1000
committerDavid Walter Seikel2014-04-20 05:49:18 +1000
commit19c1a34f96eaac715929325683e0eeb9b333caad (patch)
treeb182270b58caac85f24ccc9efa7a341d0e32c6ff
parentTypo-- (diff)
downloadSledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.zip
SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.gz
SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.bz2
SledjHamr-19c1a34f96eaac715929325683e0eeb9b333caad.tar.xz
Oops, had two widget structures. Merge them.
Diffstat (limited to '')
-rw-r--r--ClientHamr/GuiLua/GuiLua.c26
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
538struct 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
550widget has to be a light userdata 539widget has to be a light userdata
551The rest can be Lua sub things? Each with a C function to update the widget. 540The rest can be Lua sub things? Each with a C function to update the widget.
552 541
553win.quitter.look
554
555win.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) 542win.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)
556win.quitter.colour.r = 5 -> direct access to the table, well "direct" via Thing and Mum. We eventually want to call skang.colour() though. 543win.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
560struct _Widget 546struct _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
567static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 557static 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