Hi Peter,
Thanks very much for the explanation.
Larry

----- Original Message ----- From: "Peter M. Brigham" <pmb...@gmail.com>
To: "How to use LiveCode" <use-livecode@lists.runrev.com>
Sent: Tuesday, September 02, 2014 6:12 AM
Subject: Re: how to stop mouse clicks from executing?


On Sep 1, 2014, at 3:50 PM, <la...@significantplanet.org> <la...@significantplanet.org> wrote:

Hi Paul,
As Richmond says, "That's a clever idea."
However, I have no understanding of what a frontScript is and no understanding of how to trap those events.
Perhaps you'd be willing to elaborate for me?

Create a button with the following script:

on mousedown
  if <put your conditions here> then
     -- block mousedown
  else
     pass mousedown
  end if
end mousedown

on mouseup
  if <put your conditions here> then
     -- block mouseup
  else
     pass mouseup
  end if
end mouseup

Then in an openstack handler put the following line:
  insert script of btn "myFrontScript" into front

A front script resides at the very front of the message path, and all messages will pass to it before going to any controls, cards, or stacks. Anything not handled by the frontscript will then pass to the normal message path. Any message blocked by the frontscript will stop there without getting passed. Frontscripts are very useful for handling special actions that must prevail everywhere in your stack.

In most cases you will want to be sure to put the following in your closestack handler:
  remove script of btn "myFrontScript" from front
to be sure that your blocking action does not persist when it is not needed.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to