Button does not receive mouseUP after disabling then enabling button

Martin Koob mkoob at rogers.com
Sat Aug 15 17:53:51 EDT 2015


Hi 

I found another way to resolve it that works in the sample stack and in my
application.  Reading about the wait command in the dictionary I saw you can
also use send in time to give LiveCode a chance to process messages.

If I use send in time for both "setState off" and "setState on" then I can
click the button when it is re-enabled. 

Here is the workaround script for the sample button.

on mouseUp
   send "setState off" to me in 10 milliseconds
   send "setState on" to me in 3 seconds
end mouseUp

on setState pState
   lock screen
   if pState is "on" then
      enable me
      set the name of me to "on"
   else
      disable me
      set the name of me to "off"
   end if
   unlock screen
end setState

 It seems that sending in time for the first "setState off" message is what
resolves the issue.  You can just call setState "on" instead of sending and
it works too.


on mouseUp
   send "setState off" to me in 10 milliseconds
   myprocess
   setState "on" 
end mouseUp

on setState pState
   lock screen
   if pState is "on" then
      enable me
      set the name of me to "on"
   else
      disable me
      set the name of me to "off"
   end if
   unlock screen
end setState

on myprocess
   wait 3 seconds with messages
end my process


Thanks for all the help.  I will post a bug report. 



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Button-does-not-receive-mouseUP-after-disabling-then-enabling-button-tp4695119p4695143.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list