placing a group inside another using code...
dick.kriesel at mail.com
Tue Aug 14 21:29:13 CDT 2007
Hi, Andre. Rev's "owner" property is read-only, but here's a way to
overcome that limitation, as long as the new owner is a group or a card in
the same stack as the old owner.
Please let me know if it works for you, or what happened if it doesn't.
setprop uOwner pNewOwner
if first word of pNewOwner is among the items of "card,group" then
put long owner of the target into tOldOwner
if first word of tOldOwner is among the items of "card,group" then
put long name of pNewOwner into tNewOwner
if tNewOwner is not tOldOwner then
if tNewOwner is not long name of the target then
put the relayergroupedcontrols into tRelayerGroupedControls
set the relayergroupedcontrols to "true"
if first word of tNewOwner is "card" then
set the layer of the target to 1
if the long name of the target is in tNewOwner then
set the layer of tNewOwner to 1
set the layer of the target to the number of controls of this
set the layer of the target to the layer of pNewOwner + 1
set the relayergroupedcontrols to tRelayerGroupedControls
else put "new owner is the target"
else put "new owner is the old owner"
else put "old owner must be a card OR a group"
else put "new owner must be a card OR a group"
More information about the use-livecode