LockLoc and grab

Bob Sneidar bobsneidar at iotecdigital.com
Tue Jan 23 12:51:27 EST 2024


OIC. Not sure what the expected behavior is when the browse tool is selected or in a standalone but I can confirm that it works as you say. In the IDE, dragging the button outside the bounds of its parent group will update the groups rect if the pointer tool is selected, but not if the browse tool is selected. Since you mentioned a User, I suspect you are doing this in a standalone, where the only tool is the browser tool (correct me if I am wring). 

To resolve it, in the button script on mouseUp set the loc of the group to the loc of the button, or else get the lowest top left of any object in the group and the bottom right of any object in the group and set the group rect accordingly. 

Bob S


> On Jan 23, 2024, at 9:32 AM, David Epstein via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Let me try to clarify the problem I stated.
> 
> I am not trying to remove the button, I am trying to use the “grab” command to let a user move the button around the window by dragging it.
> 
> If I use a script to “set the loc” of a button to somewhere outside that group’s rectangle
> 	- the group will resize if its lockLoc property is false (thus keeping the relocated button visible); 
> 	- but the button will disappear if the group’s lockLoc property is true.
> 
> But when I use the “grab” command to relocate the button outside the group’s current rectangle the group does not resize even if its lockLoc property is false.
> 
> 
> 
>> A group with lockLoc set to false does not resize itself when an object in it is moved by a ?grab? command.  Is this a bug?  Is there a simple workaround?
>> 
>> Recipe using 10.0.0 dp6 on an intel Mac:  
>> 
>> Create a button with this script:  
>> on mouseDown; grab me; end mouseDown.  
>> Group the button.  Confirm that the group?s lockLoc property is false.  Then with the browse tool, drag the button past the edge of the group.  The button disappears.
>> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list