groups and background

Dar Scott dsc at
Fri Dec 20 12:16:01 EST 2002

On Friday, December 20, 2002, at 05:23 AM, Robert Brenstein wrote:

> It seems that the first case uses the logic that backgrounds are behind 
> the card, whereas the second case seems to consider backgrounds as 
> groups placed on a card (so the background is in front of the card so 
> do speak. My guess is that the bg attribute of a grp is ignored in this 
> case.

The problem is really the third case.  If the groups are not 
backgrounds, they are treated as such in the message path as far as 
whether the backgrounds are after the card.

Consider this card:  card{   grpA( btn1 ),  btn2,  bgB( btn3 )  }

Background bgB is in the path of btn3 and btn2, but not btn1.

Suppose I have a background that does some navigation, but also blocks a 
particular key stroke from going to the default interpretation.  If I 
put some fields on the card, the key is blocked for those fields.  (I'm 
just guessing this will work.)  But suppose I make a numerical field 
with up-down buttons, all grouped and I put that on the card.  Maybe I 
got it from a card of many such custom controls and I forgot it was a 
group.  The key stroke is not blocked.

Here is a real example.  I hope to make soon a background for 
navigation.  I hope to include some effects for card navigation.  My 
back stack includes the inverse of the effect.  Also, buttons can be 
placed on the card to jump directly to some card.  I want to use the 
same effect stack for those.  This way a series of back back back will 
feel like going back.  (That's the idea, anyway; it may end up looking 
goofy.)  This button can use the handlers of the background because it 
is in the path.  But, if I put the button in a group or for some reason 
the group does card changes, the background is not in the path.

One solution is to send directly to the background for all cases and 
just consider the background behavior of the background being after the 
card in the path in some cases as a problem rather than a solution.  
Another would be to put the background in the back scripts and be 
careful with pass recursion.

Dar Scott

More information about the Use-livecode mailing list