send (pass) a message to objects below

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ninetrees
Posts: 7
Joined: Thu Apr 22, 2010 6:54 am

send (pass) a message to objects below

Post by ninetrees » Sat May 01, 2010 5:46 am

When I put a text field over a rectangle or a rectangle over a window, I expected that it would be invisible to events if it had no script. It seems to block them though. So I tried adding on mouseDown pass mouseDown end mouseDown to top object. Still no luck. Is there a stack/card/object property to make them event invisible?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: send (pass) a message to objects below

Post by bn » Sat May 01, 2010 10:29 am

ninetree,
you might want to look at the user guide pp 134 message hierarchy to understand what is happening.
A message like mouseUp that is not "trapped" i.e. there is no script in the control to react to the event will be passed to the card than to the stack etc. until it reaches the engine.
In your case the mouse messages dont go to the control that happen to be placed at the same location as the control in front of it but to the card.
What you can do is to direct the mouse messages to the object that you want to react to mouseUp.
If you have a rectangle graphic that is on top of a button than you could put this into the script of the graphic

Code: Select all

on mouseUp
   send mouseUp to button 1 
end mouseUp
An exception to what I said is if you set the opaque of the graphic to false in the properties inspector: than the click goes "through" the graphic and reaches the underlying button. But you will only see the border of the graphic, not the fill. If you just want to "frame" something then that is the way to go. The same applies to transparent areas of an image in images that support transparency like png.
regards
Bernd

Post Reply