CharmedOne Posted August 13, 2009 Report Share Posted August 13, 2009 I always had problems with check boxes compared to buttons & getting them to enable & stay checked if enabled can someone help fix. on *:dialog:SpamKick:init:*: { if (%linkclear) == on) { did -c $dname 8 } } on *:dialog:SpamKick:sclick:8:{ if ($did(8).state == 0) { set %linkclear Off } elseif ($did(8).state == 1) { set %linkclear On } } Link to comment Share on other sites More sharing options...
err0r Posted August 13, 2009 Report Share Posted August 13, 2009 I always had problems with check boxes compared to buttons & getting them to enable & stay checked if enabled can someone help fix. on *:dialog:SpamKick:init:*: { if (%linkclear) == on) { did -c $dname 8 } } on *:dialog:SpamKick:sclick:8:{ if ($did(8).state == 0) { set %linkclear Off } elseif ($did(8).state == 1) { set %linkclear On } } You really do not need to declare both states on *:dialog:SpamKick:init:*: { if (%linkclear) == On) { did -c $dname 8 } } on *:dialog:SpamKick:sclick:8:{ if ($did(8).state == 1) { set %linkclear On } else { set %linkclear Off } } unless you have some reason for setting an off variable i would just unset the variable to keep from cluttering up the variables area on *:dialog:SpamKick:init:*: { $iif(%linkclear,did -c $dname 8) } on *:dialog:SpamKick:sclick:8:{ $iif($did(8).state == 1,set %linkclear On,unset %linkclear) } Link to comment Share on other sites More sharing options...
CharmedOne Posted August 13, 2009 Author Report Share Posted August 13, 2009 ok thanks DJV & errOr Link to comment Share on other sites More sharing options...
CharmedOne Posted August 13, 2009 Author Report Share Posted August 13, 2009 I added what you said to ErrOR I clicked my check box & clicked on/cancel but yet when I reopen it it dosent show it as checked nor does it show as turned on in my variables. Link to comment Share on other sites More sharing options...
err0r Posted August 13, 2009 Report Share Posted August 13, 2009 i just made this and it works fine dialog SpamKick { title "New Project" size -1 -1 53 37 option dbu check "test", 8, 8 17 50 10 } on *:dialog:SpamKick:init:*: { $iif(%linkclear,did -c $dname 8) } on *:dialog:SpamKick:sclick:8: { $iif($did(8).state == 1,set %linkclear On,unset %linkclear) } Link to comment Share on other sites More sharing options...
CharmedOne Posted August 14, 2009 Author Report Share Posted August 14, 2009 Thanks errOr this didnt work on *:dialog:SpamKick:sclick:8: { $iif($did(8).state == 1,set %linkclear On,unset %linkclear) } So i changed your code to this & it worked thanks for the help errOr if ($did == 8) { $iif($did(8).state == 1,set %linkclear On,unset %linkclear) } } Link to comment Share on other sites More sharing options...
err0r Posted August 14, 2009 Report Share Posted August 14, 2009 well if you left it as a sclick the did would always be 8 so if you are still using sclick:8 is seems a bit pointless.. what i posted works.. i tested it.. but as always there are different ways of doing the same thing.. whatever works for u Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now