Archive: Checkboxes defaulting to checked


Checkboxes defaulting to checked
I'm trying to figure out how to get my checkboxes to default to on. I can do the following:

${NSD_CreateCheckbox} 5% 25u 30% 10u ".jou"
Pop $CheckboxJou
${NSD_Check} $CheckboxJou

but is there a way to set it checked when it's created?

Thanks


No, you cannot create and check it in one statement. You are doing it the right way now.


Okay, I can deal with that, but it brings up another issue. I've used the example given in the nsDialog tutorial, to make it so if the User navigates back to this page, his choices are selected. But, I can't figure out how to make them checked by default when first entering the page, but retain the user's settings if he returns to the page later.
Is there a way to do this?

thanks


I use .onInit to decide what settings/current configuration exists and set variables for that. Then when creating the page I can use those variables to preselect the way that page looks. When the user leaves the page I read the controls and update the variables. If the user goes back, the variables 'remember' their choices and they will be redisplayed.


Thanks!! That's working perfectly.