From 3ead59424dad433904e406134b9f18ebf93fb93d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 4 May 2015 13:55:57 -0400 Subject: [PATCH] I am wrong there's nothing wrong with what we're doing now because only the immediate parent calls uiControlSysFunc(uiXxxSysFuncContainerDisable). --- TODO.md | 4 ---- test/page2.c | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index be6af3a0..be62e75c 100644 --- a/TODO.md +++ b/TODO.md @@ -51,10 +51,6 @@ - drop "Page" from uiTab method names? (uiTabAppendPage() -> uiTabAppend()) - override dock menu quit item to act like our app menu quit item - consider calling setAppleMenu: for the application menu; it doesn't seem to make much of a difference but -- I have a feeling the container enable/disable logic we have won't work with two levels of controls to enable... - - perhaps drop ContainerENable/Disable entirely and make enabling and disabling counted: each call to Disable() increments a counter and each call to Enable() decrements it - - would be error-prone on the user's side, even if Enable() with refcount == 0 is a no-op - - what does GTK+ do? ultimately: - add some sort of runtime type checking diff --git a/test/page2.c b/test/page2.c index 3a8871b1..d0487ecf 100644 --- a/test/page2.c +++ b/test/page2.c @@ -98,7 +98,9 @@ uiBox *makePage2(void) nestedBox = newHorizontalBox(); innerhbox = newHorizontalBox(); uiBoxAppend(innerhbox, uiControl(uiNewButton("These")), 0); - uiBoxAppend(innerhbox, uiControl(uiNewButton("buttons")), 0); + button = uiNewButton("buttons"); + uiControlDisable(uiControl(button)); + uiBoxAppend(innerhbox, uiControl(button), 0); uiBoxAppend(nestedBox, uiControl(innerhbox), 0); innerhbox = newHorizontalBox(); uiBoxAppend(innerhbox, uiControl(uiNewButton("are")), 0); @@ -112,7 +114,9 @@ uiBox *makePage2(void) innerhbox2 = newHorizontalBox(); uiBoxAppend(innerhbox2, uiControl(uiNewButton("nested")), 0); innerhbox3 = newHorizontalBox(); - uiBoxAppend(innerhbox3, uiControl(uiNewButton("boxes")), 0); + button = uiNewButton("boxes"); + uiControlDisable(uiControl(button)); + uiBoxAppend(innerhbox3, uiControl(button), 0); uiBoxAppend(innerhbox2, uiControl(innerhbox3), 0); uiBoxAppend(innerhbox, uiControl(innerhbox2), 0); uiBoxAppend(nestedBox, uiControl(innerhbox), 0);