venerdì 22 marzo 2019

Fare un pulsante toggle

I pulsati tipo toggle sono pulsanti che rimangono schiacciati finchè non li premete nuovamente. Ecco un esempio:

Per ottenere questo effetto, basta usare il seguente codice:
on MouseUp
   put the hilite2 of me into hitemp
   if hiTemp then
      set the hilite2 of me to false
   else
      set the hilite2 of me to true
   end if
end MouseUp

setprop hilite2 temp
   set the hilite of me to temp
   set the hilite2 of me to temp
end hilite2