Groups in the message path: Trapping Mouseup

Paul Dupuis paul at researchware.com
Tue Dec 10 14:56:34 EST 2019


So if I have a button X with a mouseDown handler in a Group Y also with 
a mouseDown handler and in my card script (or stack script) also have a 
mouseDown handler

If I click on button X and I only want button X to handle the mouseDown, 
I do not 'pass mouseDown' in the button X mouseDown handler

If I click on button X and I also want another mouseDown handler in the 
message path - in addition to the one in button X - to do something in 
response, then I need to 'pass mouseDown' in the button script. In this 
example, a pass mouseDown in the button mouseDown handler passes the 
message to the group that contains the button. If that group's mouseDown 
handler also does a pass mouseDown, then the card or stack gets the 
mouseDown as well. If they do not pass the message its stops there.

Richard Gaskin, at one point, had a really excellent diagram of the 
LiveCode message hierarchy. If he sees this post and still has it 
perhaps he could post a link to it.


On 12/10/2019 2:39 PM, Sannyasin Brahmanathaswami via use-livecode wrote:
> So then to trap "the target" in the stack script, require putting
>            pass mousedown (or mouseWhatever)
> in all the background groups (all of which contain their our MouseDown)
>
> Correct?
>
> remember the use case:
> we do not want and script in *any* button or top object that receives a click or touch.  The card becomes a pure "view" object.
>
> @paul
>
> If you have groups where you need to pass a mouseDown (or mosueWhatever)
> mesage to the card or stack, just add a behavior to the group for a
> script that contain handlers like
>
> on mouseDown
>    pass mouseDown
> end mouseDown
>
> on mouseUp
>    pass mouseUp
> end mouseUp
>
> Although if there is no handler for the mouse event it should pass to
> the card and then the stack and then any library or backscripts and then
> the engine.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list