Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Checkboxes defaulting to checked (http://forums.winamp.com/showthread.php?t=297305)

DukeBrymin 12th September 2008 21:44

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

demiller9 12th September 2008 22:05

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

DukeBrymin 12th September 2008 22:10

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

demiller9 12th September 2008 22:29

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.

DukeBrymin 15th September 2008 15:29

Thanks!! That's working perfectly.


All times are GMT. The time now is 04:34.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.