Go to Page... |
Thread Tools | Display Modes |
07/27/14, 03:38 PM | #1 |
|
Why control:SetHidden(true) doesn't hide the control?
I tried to make something Atropos described here http://www.esoui.com/downloads/info7....html#comments (couldn't find a way to link directly to the comment).
I'm doing something wrong, and I'm not sure whether it's LAM-specific or not. Here's my code: Lua Code:
It's a panel with 5 controls: "Refresh #counter" .. only to track number of refresh calls "Foo module" .. sets foobarConf.Foo to true/false, which should show/hide Foo feature option(s) below it "Foo feature Alpha" .. dummy option "Bar module" .. sets foobarConf.Bar to true/false, which should show/hide Bar feature option(s) below it "Bar feature Beta" .. dummy option foobarRefreshPanel() gets called properly, every time it passes tests at the top, it increases "Refresh #counter". But showing/hiding controls is somehow broken. For example if I have "Foo module ON", and turn it OFF, then when I come across "Foo feature Alpha" in controlsToRefresh loop, I call control:SetHidden(true) (because control.data.parentModule == "Foo" and foobarConf["Foo"] == false), but the control doesn't disappear, only becomes unresponsive (doesn't react to mouse over, click). If I switch to another LAM panel and back, the control is hidden properly. It's even more weird if you uncomment ClearAnchors/SetAnchor lines. The anchors are apparently reprocessed, turning "Foo module" OFF pushes "Bar module" up as if "Foo feature Alpha" wasn't there (which it shouldn't, of course). So, what do I need to do to make a control actually disappear after SetHidden(true), and re-appear after SetHidden(false)? |
07/27/14, 04:09 PM | #2 |
|
Ok so it has something to do with CreateTopLevelWindow
When I change this in LAM/controls/checkbox.lua: Lua Code:
to this: Lua Code:
... then my above code simply works |
07/27/14, 04:19 PM | #3 |
I think the idea is that the TopLevelWindow won't have a parent. By default it's parent is GuiParent. You would use Control to create controls/windows/frames that are children of other windows/controls/frames.
|
|
ESOUI » Developer Discussions » Lua/XML Help » Why control:SetHidden(true) doesn't hide the control? |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|