diff --git a/TODO.md b/TODO.md index 28243421..907b7f3e 100644 --- a/TODO.md +++ b/TODO.md @@ -35,6 +35,10 @@ - make sure complain()s don't have \n at the end; add one on each platform - add a `[libui]` to the beginning of the message - figure out what to do on Windows and GTK+ if we don't have menus but the user wants a menubar (zero-height widget? don't bother? complain?) +- bin.c + - find a way to consolidate the duplicate code across OSs + - find a way to move the has parent check at the beginning of binDestroy() + - determine whether or not margins count in preferredSize() when there is no main control ultimately: - add some sort of runtime type checking diff --git a/darwin/bin.m b/darwin/bin.m index a1c6a978..e8b7dd46 100644 --- a/darwin/bin.m +++ b/darwin/bin.m @@ -15,7 +15,6 @@ void binDestroy(uiControl *c) { struct bin *b = (struct bin *) c; - // TODO find a way to move the parented check here // we can't check for an OS parent here because what we're working with with bin isn't subviews but rather content views (at least I think... TODO) // don't chain up to base here; we need to destroy children ourselves first if (b->mainControl != NULL) { @@ -32,7 +31,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig struct bin *b = (struct bin *) c; intmax_t marginX, marginY; - // TODO have the margins count even if no control? if (b->mainControl == NULL) { *width = 0; *height = 0; diff --git a/unix/bin.c b/unix/bin.c index 6ffe79c0..3fe47d5c 100644 --- a/unix/bin.c +++ b/unix/bin.c @@ -1,8 +1,6 @@ // 28 april 2015 #include "uipriv_unix.h" -// TODO find a way to consolidate duplicate code across OSs - struct bin { uiContainer c; void (*baseDestroy)(uiControl *); @@ -18,7 +16,6 @@ void binDestroy(uiControl *c) struct bin *b = (struct bin *) c; GtkWidget *binWidget; - // TODO find a way to move the parented check here // ensure clean removal by making sure the bin has no OS parent binWidget = GTK_WIDGET(uiControlHandle(uiControl(b))); if (gtk_widget_get_parent(binWidget) != NULL) @@ -38,7 +35,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig struct bin *b = (struct bin *) c; intmax_t marginX, marginY; - // TODO have the margins count even if no control? if (b->mainControl == NULL) { *width = 0; *height = 0; diff --git a/windows/bin.c b/windows/bin.c index 66c2fb1f..ff7ec287 100644 --- a/windows/bin.c +++ b/windows/bin.c @@ -16,7 +16,6 @@ void binDestroy(uiControl *c) struct bin *b = (struct bin *) c; HWND hwnd; - // TODO find a way to move the parented check here // ensure clean removal by making sure the bin has no OS parent hwnd = (HWND) uiControlHandle(uiControl(b)); if (GetAncestor(hwnd, GA_PARENT) != NULL) @@ -36,7 +35,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig struct bin *b = (struct bin *) c; intmax_t marginX, marginY; - // TODO have the margins count even if no control? if (b->mainControl == NULL) { *width = 0; *height = 0;