devin_asay at byu.edu
Mon Jan 4 15:40:41 CST 2010
On Jan 1, 2010, at 12:45 PM, David Bovill wrote:
> Just noticed that the deleteGroup message is not sent when the group
> nested - anyone got an idea how to get around this?
> Say you have a group that you want to do some tidying up if a user
> it - and so you put a handler like this in the group itself:
> on deleteGroup
>> pass deleteGroup
>> end deleteGroup
> Which works fine if it is a toplevel group - but when this group is
> another group deleting the toplevel group triggers a deleteGroup
> which travels up the hierarchy to the card - but no deleteGroup
> messages are
> sent from the inner groups - this means you can't attach appropriate
> behaviors to the groups.
> Wandering if anyone has looked at this - I can't think how to do it as
> deleteGroup is sent after deletion so even a frontscript would not
> be able
> to tell what was inside a deleted group. Even the new closeControl
> does not seem to be sent in these circumstances?
Maybe you'll need to check the child objects of the group before you
delete the parent group. If they have child groups delete them first
from the "inside out", so that each group is deleted individually and
so triggers the deleteGroup message.
repeat with x= 1 to the number of groups in group "parent"
if there is a group x of group "parent" then
delete group x of group "parent"
Humanities Technology and Research Support Center
Brigham Young University
More information about the use-livecode