diff --git a/include/Mw/TypeDefs.h b/include/Mw/TypeDefs.h index e9dbec0..fd72922 100644 --- a/include/Mw/TypeDefs.h +++ b/include/Mw/TypeDefs.h @@ -40,7 +40,7 @@ typedef void (*MwHandler)(MwWidget handle); typedef int (*MwHandlerWithStatus)(MwWidget handle); typedef void (*MwHandlerProps)(MwWidget handle, char** key); typedef void (*MwHandlerProp)(MwWidget handle, const char* key); -typedef void (*MwHandlerChildrenUpdate)(MwWidget handle, MwWidget child, int _new); +typedef void (*MwHandlerChildrenUpdate)(MwWidget handle, MwWidget child, int new_child); typedef void (*MwHandlerChildrenProp)(MwWidget handle, MwWidget child, const char* key); typedef void (*MwHandlerKey)(MwWidget handle, int key); typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr); diff --git a/src/widget/box.c b/src/widget/box.c index 87807f4..00b5723 100644 --- a/src/widget/box.c +++ b/src/widget/box.c @@ -120,11 +120,11 @@ static void resize(MwWidget handle) { MwForceRender(handle); } -static void children_update(MwWidget handle, MwWidget child, int new) { +static void children_update(MwWidget handle, MwWidget child, int new_child) { MwBox b = handle->internal; (void)child; - (void)new; + (void)new_child; b->layout = 1; diff --git a/src/widget/tab.c b/src/widget/tab.c index 11d5861..136a148 100644 --- a/src/widget/tab.c +++ b/src/widget/tab.c @@ -2,6 +2,8 @@ #include "../../external/stb_ds.h" +#define SOME_FIX + static void resize(MwWidget handle); static int wcreate(MwWidget handle) { @@ -190,7 +192,11 @@ static void click(MwWidget handle) { static MwWidget mwTabAddImpl(MwWidget handle, const char* name) { MwTab t = handle->internal; +#ifdef SOME_FIX + MwWidget f = MwCreateWidget(MwFrameClass, "tabframe", handle, MwDefaultBorderWidth(handle), tab_height(handle) + MwDefaultBorderWidth(handle), MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2); +#else MwWidget f = MwCreateWidget(MwFrameClass, "tabframe", handle, 0, MwGetInteger(handle, MwNheight), MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2); +#endif char* n = MwStringDuplicate(name); arrput(t->frames, f); @@ -202,6 +208,11 @@ static MwWidget mwTabAddImpl(MwWidget handle, const char* name) { MwSetInteger(handle, MwNvalue, arrlen(t->frames) - 1); show_frame(handle); } +#ifdef SOME_FIX + else{ + MwLLShow(f->lowlevel, 0); + } +#endif return f; } @@ -237,6 +248,9 @@ static void resize(MwWidget handle) { for(i = 0; i < arrlen(t->frames); i++) { int y = MwGetInteger(handle, MwNheight); +#ifdef SOME_FIX + MwLLShow(t->frames[i]->lowlevel, i == v); +#else if(i == v) y = tab_height(handle) + MwDefaultBorderWidth(handle); MwVaApply(t->frames[i], @@ -245,6 +259,11 @@ static void resize(MwWidget handle) { MwNwidth, MwGetInteger(handle, MwNwidth) - MwDefaultBorderWidth(handle) * 2, MwNheight, MwGetInteger(handle, MwNheight) - tab_height(handle) - MwDefaultBorderWidth(handle) * 2, NULL); + + if(i == v){ + + } +#endif } } diff --git a/src/widget/table.c b/src/widget/table.c index ecd778c..788d5cc 100644 --- a/src/widget/table.c +++ b/src/widget/table.c @@ -170,11 +170,11 @@ static void resize(MwWidget handle) { MwForceRender(handle); } -static void children_update(MwWidget handle, MwWidget child, int new) { +static void children_update(MwWidget handle, MwWidget child, int new_child) { MwTable t = handle->internal; t->layout = 1; - if(new) { + if(new_child) { arrput(t->widgets, child); } else { int i;