Hi there,
I have a button labeled "A". When pressed its label changes to "B" and the button is disabled for one second. After that second, the button resets (i.e., becomes enabled again and is labeled "A"). Basically, I want users to see the label change in that one second, but I know that users will be trying to click as fast as possible on the button to get to the next phase. I have tried to get around this by disabling the button for the one second, so that they cannot click in that time. This method sort of works, but the disabled button label text fades to a grey, which is bad.
Can anyone think of a way of changing the disabled button color to black? Or any other way of achieving what I want (stopping users from clicking really fast and hence not noticing the label change).
Cheers,
Adrian
Change disabled button text color
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
There's probably a million ways you could apply here, butThis should work. You can still set the properties of a disabled button. In this case, backcolor should be the thing you need. You may possibly have to fiddle with the Appearance Manager, but I think this should get you going.
HTH
Code: Select all
on mouseUp
set the disabled of me to true
set the label of me to "B"
set the backcolor of me to black
send "reactivateButton" to me in 1 second
end mouseUp
on reactivateButton
set the disabled of me to false
set the backcolor of me to red --or the usual colour you want for the button
set the label of me to "A"
end reactivateButton
HTH
another possibility is just take way the script it performs for 1 second instead of disabling it.
this way the button doesn't get disabled. It just becomes useless for 1 second.
Code: Select all
on mouseUp
global tPreventUse
if tPreventUse <> true
then
put true into tPreventUse
set the label of me to "B"
send "reactivateButton" to me in 1 second
end if
end mouseUp
on reactivateButton
global tPreventUse
set the label of me to "A"
put false into tPreventUse
end reactivateButton