View Single Post
Old 22nd December 2019, 22:56   #1
mhertz
Junior Member
 
Join Date: Dec 2019
Posts: 6
.onSelChange question of unselectsection etc.

I'm sorry, this is a beginner slash stupid question, but kindly bear with me please.

I have issue with when conditionally wanting one checkbox to unselect another and vice-versa, it only works one way but never the other? I'm sure though i'm misunderstanding something obvious.

Let's take a simple example, two checkboxes section1 and section2, where the first is selected by default. When selecting section2, then I want section1 to be unticked, and vice-versa. However with my tries it never works like that, and only works one way, but never the other, and neither when having more dynamic checkboxes than in my simple example here:
code:

Section "foo" Section1
SectionEnd

Section /o "bar" Section2
SectionEnd

Function .onSelChange
${If} ${SectionIsSelected} ${Section1}
!insertmacro UnselectSection "${Section2}"
${EndIf}
${If} ${SectionIsSelected} ${Section2}
!insertmacro UnselectSection "${Section1}"
${EndIf}


Or:
code:

Section "foo" Section1
SectionEnd

Section /o "bar" Section2
SectionEnd

Function .onSelChange
${If} ${SectionIsSelected} ${Section1}
!insertmacro UnselectSection "${Section2}"
${Else}
${If} ${SectionIsSelected} ${Section2}
!insertmacro UnselectSection "${Section1}"
${EndIf}
${EndIf}


Or simply:
code:

Section "foo" Section1
SectionEnd

Section /o "bar" Section2
SectionEnd

Function .onSelChange
${If} ${SectionIsSelected} ${Section1}
!insertmacro UnselectSection "${Section2}"
${Else}
!insertmacro UnselectSection "${Section1}"
${EndIf}


Or with e.g. ${OrIf} instead it's the same, and I just don't get it sorry, while of course knowing i'm an idiot here and fully missing something completely obvious, for anybody else than me though

Thank you so much in advance!
mhertz is offline   Reply With Quote