![]() |
#1 |
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: Or: code: Or simply: code: 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! |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
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:
PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Dec 2019
Posts: 6
|
Thanks alot Anders for your kind help once again!
![]() I honestly don't get why a state is needed when making a comparisson, and if both checkboxes are unticked then obviously the comparissons all should just return void and unmatched(as code run on every change happening), but what do I know. Anyway, i'm really glad I know now that I have to utilize that $0 then(i'm on NSIS3 latest), I did saw that before but never thought it was actually needed. Testing your first example of course works beatifully, what a nice feeling seeing something finally working as intended! Especially after so many failings. Thank you so much again! |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|