Relayering and dragging a group within a group

Ken Ray kray at sonsothunder.com
Mon Jun 5 22:21:39 EDT 2006


On 6/5/06 8:41 PM, "David Epstein" <dfepstein at comcast.net> wrote:


> My simpler approach (script below) can also do the relayering job.
> Its defect is that for some reason the "grab" command at the end is
> ignored, whereas in the Lynch-inspired script the "grab" command
> works as intended.  Does leaving "group editing mode" somehow
> terminate the mouseDown handler?

Probably... you could try using a "send" command to get the grab:

on mouseDown
  if "button" is in the target then

    -- (1) put the group this button belongs to on top of other
    -- groups that are subgroups of group "wb":
    put the short id of the owner of the target into tgid
    start editing group "wb"
    set the layer of group id tgid to top
    stop editing
    send "grabIt" && tgid to me in 50 milliseconds
  end if
end mouseDown

on grabIt pID
    -- (2) move this group with the mouse until the mouse is released:
    grab group id pID of group "wb" -- DOES THIS WORK?
end grabIt


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list