Relayering and dragging a group within a group

dfepstein at comcast.net dfepstein at comcast.net
Wed Jun 7 11:59:51 EDT 2006


Thanks to Ken Ray for his suggestion (quoted below) of how to "grab" a group on the same mousedown that relayers it.  Unfortunately, using "send" doesn't work, I think because (according to MC docs) we can only call "grab" from a mouseDown handler.  In fact I think it's the peculiar character of the grab command that's the key here, since other commands inserted after a "stop editing" statement will work.

David Epstein

> 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



More information about the use-livecode mailing list