mhollander
17th July 2003 18:39 UTC
Please - Need help debugging this code that plays with sections
Please could someone look at this code and tell me why the tree structure comes undone.
This is an excerpt of a very large script and I need it to work this way as it is part of an installation - step by step wizard.
I have attached a sample script.
Requirements:
The options must be deselected by default
The options must be hidden by default
Depending on certain conditions these options will be enabled.
In short need to apply the filter as seen in the script.:igor:
kichik
17th July 2003 18:44 UTC
It's a known issue. You can't hide a subsection without ruining the tree unless you hide the subsection closure too. Get the id of the last section in the subsection, add 1 (using IntOp), set its name to "" and remove the SF_SUBSEC flag from it.
We intend to make NSIS automatically hide subsections if they're emtpy. It's on the TODO.
mhollander
17th July 2003 18:46 UTC
Could you give me an example as I am not sure what you are getting at.
:)
kichik
17th July 2003 18:54 UTC
SubSection bla
Section blue SecID
SectionEnd
SubSectionEnd
...
IntOp $0 ${SecID} + 1
SectionSetText $0 ""
SectionSetFlags $0 0
mhollander
18th July 2003 16:17 UTC
Hi Kichik,
I am trying to make sense of the example. Please excuse me if I appear to be extremely thick.
Could you please use the example I posted with your proposed changes, so that I can see how it would be implemented. I do not quite get the current example given. It would be appreciated.
kichik
18th July 2003 16:22 UTC
blue is the last section in the subsection bla. Therefore we take its section ID, add one and get the ID of the closing section. That section we hide too.
I won't apply that to your example, it's huge.
mhollander
21st July 2003 12:07 UTC
Thanks,
Kichik.
I have included an updated script for newbies like myself that have battled with this a working example.
:cool: