scripts of groups

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

scripts of groups

Post by scotttyang » Thu May 01, 2014 7:34 pm

I wrote a script for a group of btns, but the script won't work unless it's in the objects of the group. I thought there was a checkbox for the groups property inspector that tells live code to run the group script v. object script. I guess I forgot. How do I tell live code to run the group script instead?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: scripts of groups

Post by jmburnod » Thu May 01, 2014 8:24 pm

Hi Scott,
I thought there was a checkbox for the groups property inspector that tells live code to run the group script v. object script. I guess I forgot. How do I tell live code to run the group script instead?
I think you gave to set the backgroundbehavior of your group to true
(or set the checkbox "behave like a background in the inspector)
Kind regards
Jean-Marc
https://alternatic.ch

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: scripts of groups

Post by capellan » Thu May 01, 2014 8:25 pm

Could we see the script of this group?

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Contact:

Re: scripts of groups

Post by DarScott » Thu May 01, 2014 8:28 pm

The incomplete story of groups and the message paths is this:

If you click on an object in the group, mouseUp and other messages are sent to the object. If it doesn't handle it or it passes the message, it goes to the group and then the card. If you click on the group outside of an object, the mouseUp is sent to the card. But, if the card is shared and has its background behavior set to true, then the message path is card and then group.

There might be some other things related to groups in groups.

I don't think this is exactly how it worked a few years back, but I can't be sure.

So, if you do not create a handler for (say) mouseUp in an object, then a handler for it in the group should work.

If you want to block the execution of the handler in the object, you can put an "opaque" object with a blend of 0% in the group in front of the objects. You might consider a frontScript, but that is scary.

You might be thinking of behaviors. Check those out.

Post Reply