From 9f0729de1c7948f4db6e9423cb6f49ab88496531 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 17 Apr 2015 13:43:01 -0400 Subject: [PATCH] Changed uiParentSetChild() to uiParentSetMainControl(). Backend changes incoming. --- darwin/tab.m | 2 +- darwin/window.m | 2 +- parentplan | 7 +++---- ui.idl | 3 +-- unix/tab.c | 2 +- unix/window.c | 2 +- windows/tab.c | 2 +- windows/window.c | 2 +- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/darwin/tab.m b/darwin/tab.m index b84ee9af..8d87b34b 100644 --- a/darwin/tab.m +++ b/darwin/tab.m @@ -41,7 +41,7 @@ static void tabAddPage(uiTab *t, const char *name, uiControl *child) NSTabViewItem *i; content = uiNewParent(0); - uiParentSetChild(content, child); + uiParentSetMainControl(content, child); i = [[NSTabViewItem alloc] initWithIdentifier:nil]; [i setLabel:toNSString(name)]; diff --git a/darwin/window.m b/darwin/window.m index c243374a..94d2dbb5 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -93,7 +93,7 @@ static void windowOnClosing(uiWindow *w, int (*f)(uiWindow *, void *), void *dat static void windowSetChild(uiWindow *w, uiControl *c) { - uiParentSetChild(D.content, c); + uiParentSetMainControl(D.content, c); } static int windowMargined(uiWindow *ww) diff --git a/parentplan b/parentplan index 83c581e0..4146108c 100644 --- a/parentplan +++ b/parentplan @@ -14,7 +14,7 @@ i entry w = NewWindow() p = NewParent(w.Handle) w.SetChild(c) - p.SetChild(c) + p.SetMainControl(c) c.SetParent(p) d.SetParent(p) e.SetParent(p) @@ -34,7 +34,7 @@ g.Hide() p.Update() c.Resize() w.SetChild(i) - p.SetChild(i) + p.SetMainControl(i) c.SetParent(NULL) d.SetParent(NULL) ... @@ -43,7 +43,7 @@ w.SetChild(i) p.Update() i.Resize() w.SetChild(NULL) - p.SetChild(NULL) + p.SetMainControl(NULL) i.SetParent(NULL) p.Update() w.SetChild(i) @@ -53,5 +53,4 @@ w.Destroy() i.Destroy() TODO -- rename these methods - p.DeferUpdate()/p.EndDeferUpdate() diff --git a/ui.idl b/ui.idl index b6d4317a..2fd25245 100644 --- a/ui.idl +++ b/ui.idl @@ -62,8 +62,7 @@ interface Parent { // TODO destroy // TODO object destruction debug handler func Handle(void) uintptr_t; - // TODO rename and clean this up - func SetChild(c *Control); + func SetMainControl(c *Control); func SetMargins(left intmax_t, top intmax_t, right intmax_t, bottom intmax_t); // TODO Resize? func Update(void); diff --git a/unix/tab.c b/unix/tab.c index 164ab428..02467ad0 100644 --- a/unix/tab.c +++ b/unix/tab.c @@ -32,7 +32,7 @@ static void tabAddPage(uiTab *tt, const char *name, uiControl *child) } content = uiNewParent((uintptr_t) (t->container)); - uiParentSetChild(content, child); + uiParentSetMainControl(content, child); uiParentUpdate(content); gtk_notebook_set_tab_label_text(t->notebook, GTK_WIDGET(uiParentHandle(content)), name); diff --git a/unix/window.c b/unix/window.c index 5c60d3c2..d87b58c2 100644 --- a/unix/window.c +++ b/unix/window.c @@ -88,7 +88,7 @@ static void windowSetChild(uiWindow *ww, uiControl *c) { struct window *w = (struct window *) ww; - uiParentSetChild(w->content, c); + uiParentSetMainControl(w->content, c); uiParentUpdate(w->content); } diff --git a/windows/tab.c b/windows/tab.c index b50140ed..7cf105cd 100644 --- a/windows/tab.c +++ b/windows/tab.c @@ -131,7 +131,7 @@ void tabAddPage(uiTab *tt, const char *name, uiControl *child) n = SendMessageW(t->hwnd, TCM_GETITEMCOUNT, 0, 0); parent = uiNewParent((uintptr_t) (t->hwnd)); - uiParentSetChild(parent, child); + uiParentSetMainControl(parent, child); uiParentUpdate(parent); if (n != 0) // if this isn't the first page, we have to hide the other controls ShowWindow(uiParentHWND(parent), SW_HIDE); diff --git a/windows/window.c b/windows/window.c index e9360eb7..eb6a552f 100644 --- a/windows/window.c +++ b/windows/window.c @@ -144,7 +144,7 @@ static void windowSetChild(uiWindow *ww, uiControl *c) { struct window *w = (struct window *) ww; - uiParentSetChild(w->content, c); + uiParentSetMainControl(w->content, c); // don't call uiParentUpdate(); instead, synthesize a resize // otherwise, we'll have a 0x0 content area at first SendMessageW(w->hwnd, msgUpdateChild, 0, 0);