View Single Post
Old 23rd December 2019, 00:24   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,221
In NSIS 2 you probably have to keep some state, take a look at Examples\one-section.nsi

In NSIS 3 the index of the changed section is in $0:

PHP Code:
Function .onSelChange
This is not like radio buttonsboth can be unselected:
${If} $
= ${Section1}
${
AndIf} ${SectionIsSelected} ${Section1}
    !
insertmacro UnselectSection "${Section2}"
${ElseIf} ${SectionIsSelected} ${Section2}
    !
insertmacro UnselectSection "${Section1}"
${EndIf}
FunctionEnd 
PHP Code:
Function .onSelChange
Radio:
${If} $
= ${Section1}
    !
insertmacro SelectSection "${Section1}"
    
!insertmacro UnselectSection "${Section2}"
${Else}
    !
insertmacro SelectSection "${Section2}"
    
!insertmacro UnselectSection "${Section1}"
${EndIf}
FunctionEnd 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote