mouseMove & backgoundBehavior

Richard Gaskin ambassador at fourthworld.com
Thu Apr 27 14:35:17 EDT 2017


dunbarx wrote:

 > I understand the reordering of the layers in the hierarchy. That is
 > not the issue. If you modify the handler:
 >
 > on mousemove newMouseH, newMouseV
 >    if the mouseLoc is within the rect of me then put newMouseH, 
newMouseV
 > end mousemove
 >
 > Even with backGroundBehavior set to "true", the message now only
 > fires when the cursor is within the rect. Like it should. It is a
 > matter of, er, control, not message passing. The constraint to be
 > within the rect implies that the control is just what it seems to
 > be, that is, only as large as it seems to be. This regardless of
 > any change in the hierarchy.
 >
 > The group does not "take over" the whole card in the sense that you
 > imply, unless (not impossible at all) I misunderstand you.

It's true that we can introduce a condition that constrains the outcome, 
but that's about the condition, not the change to the message path that 
gets introduce when you turn a group into a background.

Remember, in LC a group and a background may be the same physical 
objects, but they serve different roles.

HC never had a mouseMove message, so that may be less intuitive.  Let's 
consider another mouse message, mouseUp, instead:

If you put a mouseUp at the card or stack level, what happens?

Is it what you would expect?

Would you expect a background script situated in the message path 
between the two to act differently?

Change mouseUp to mouseMove (and most other messages), and unless I'm 
even shorter on sleep this morning than I think I am, I believe that 
appears to be what we're seeing here, no?

I think the challenge here is the flexibility of LC's groups.  It's 
possible to have a background that is smaller than the card.  And we can 
even have multiple backgrounds.  These are things we didn't have in HC, 
so when we need to support HC paradigms it can get confusing.

If it helps, limit your layout to one background, make it the full size 
of the card, keep it at layer 1, and voila! you have HyperCard. :)

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list