Skip to content
Buzzen Chat Network

Checkbox Trouble

A TG007 community discussion started by CharmedOne.

Discussion 7 posts
Page 1 of 1
Open
Topic #13268 · 7 published posts · 1,600 views

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 }
}

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)   }

Edited Aug 13, 2009 8:48 PM by err0r

Get information about ircWx here

ok thanks DJV & errOr :D

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.

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)   }

Edited Aug 13, 2009 11:24 PM by err0r

Get information about ircWx here

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)   }
}

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

Get information about ircWx here