I have groups that act as markers on a map image. Each of these groups is a rectangle, text field, and button. I would like to have the user click on a button in the group and delete that group. How to do this? I can remove the group, but it's still hanging around. How do I get rid of it without selecting it and hitting the "delete" button?
Thanks
Group deleting itself via script (answered)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Group deleting itself via script (answered)
Last edited by monki on Thu Mar 02, 2017 10:29 pm, edited 1 time in total.
Re: Delete Group via script
Hi.
Not quite sure what you mean, but if you make two groups on a new card, and ask for the number of groups, you will get 2.
If you delete one group, and ask again, you will get 1. Delete really deletes.
Craig Newman
Not quite sure what you mean, but if you make two groups on a new card, and ask for the number of groups, you will get 2.
If you delete one group, and ask again, you will get 1. Delete really deletes.
Craig Newman
Re: Delete Group via script
Ok, I see. I'm having a different problem then I thought. I'm asking a group to delete itself. Even tho the actual delete script is at stack level, it's being called by the object to be deleted. The script is blocking itself with an execution error:
I tried dispatching the command call rather than directly, using the command's name, but the same error. Is there some other way to accomplish this?...object's script is executing near button "deleteSequence" of Group...
-
- Livecode Staff Member
- Posts: 864
- Joined: Fri Feb 06, 2015 4:03 pm
Re: Delete Group via script
Hi Monki,
I have tried this in LC 8.1.3 and it works:
- Card with one grouped button
- Script of button:
- Script of card:
Best,
Panos
--
I have tried this in LC 8.1.3 and it works:
- Card with one grouped button
- Script of button:
Code: Select all
on mouseUp
send "deleteThisGroup" to card 1 in 10 milliseconds
end mouseUp
Code: Select all
on deleteThisGroup
delete grp 1
end deleteThisGroup
Panos
--
Re: Delete Group via script
That was the answer, thanks Panos 
