Still a beginner who doesn't know how to make a group.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: Still a beginner who doesn't know how to make a group.

Post by CAsba » Mon Nov 20, 2023 1:48 pm

All resolved now, many thanks to all mentors and clairvoyants !
Casba
and.. er.. Susan

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Still a beginner who doesn't know how to make a group.

Post by Klaus » Mon Nov 20, 2023 2:33 pm

CAsba wrote:
Mon Nov 20, 2023 1:48 pm
All resolved now, many thanks to all mentors and clairvoyants !
Casba
and.. er.. Susan
:D :D :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Still a beginner who doesn't know how to make a group.

Post by dunbarx » Mon Nov 20, 2023 3:55 pm

CAsba.

What I want to make sure of is that you see a group is just another type of control, like a button or field. The fact that a group can contain other controls makes it a bit special, but otherwise no different than any other control. So simply naming it should not ever have been an issue here.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Still a beginner who doesn't know how to make a group.

Post by richmond62 » Mon Nov 20, 2023 4:00 pm

"Big fleas have little fleas upon their backs to bite them, and little fleas have lesser fleas, and so ad infinitum."

1733 Swift

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Still a beginner who doesn't know how to make a group.

Post by dunbarx » Mon Nov 20, 2023 4:17 pm

All.

Richmond wrote:
If you group several objects and then give that group a name, then, at a later date, ungroup the group, that group continues to 'exist' even though it no longer contains the objects it previously contained.
This fact has always intrigued me. On a fresh card:

1- Create a group of several controls and name it. Ask for the number of groups and you will see "1". Makes sense...
2- Ungroup in any convenient way. Asking for the number of groups now gives "0". Well and good.
3-Now delete all the controls.
4- Make some new controls and group them.
5- The new group has the name of the original.

This is just how LC works, and one can get used to anything. But what about asking for the number of groups and getting "0". Obviously LC stores the fact that there once was a group, and with a certain name, and reconstitutes it when it is called upon to create a new group.

Note that if one deletes the group, as opposed to simply, er, ungrouping the children, that group is gone, as it should be.

But where is that group after it was merely ungrouped? I would not think anything amiss if LC reported that there was indeed a group somewhere, however invisible and inaccessible, as long as it reported a "1" when asked for the number of groups as in #2 above. That query into the number of groups, which is sort of wrong, could cause real problems, it seems to me.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Still a beginner who doesn't know how to make a group.

Post by jacque » Mon Nov 20, 2023 6:47 pm

Obviously the group has to be SELECTED and that only happens right after you have grouped the objects.
I'm not sure if you meant this was the only way, or the only automated way to select a group, but just in case, you can select a group from the project browser, the application overview, or by toggling the "Select Grouped" icon in the toolbar.

CAsba, regards to Susan. :)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Still a beginner who doesn't know how to make a group.

Post by jacque » Mon Nov 20, 2023 6:52 pm

But where is that group after it was merely ungrouped?
This dates back to MetaCard. The group is retained in RAM temporarily so it can support undo. It's fleeting. Changing cards, for instance, destroys it and it's gone forever. I've needed that undo feature more than once.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Still a beginner who doesn't know how to make a group.

Post by dunbarx » Mon Nov 20, 2023 8:17 pm

Jacque.

Really? To support undo?

Well, why not? So now at least I understand why I can have zero groups, yet still recreate an earlier one from nowhere.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Still a beginner who doesn't know how to make a group.

Post by dunbarx » Mon Nov 20, 2023 8:31 pm

Jacque.

And I guess groups are unique among all controls in that they have an existence apart from the control they are, if that makes sense. But then why does this not end up with a "XXX"?

Code: Select all

on mouseUp
   create group "XXX"
   answer the number of groups  -- get a "1"
   ungroup group 1
   group --should reconstitute the group?
   answer the name of grp 1 --error, no such background
end mouseUp
I guess undoing an "ungroup" command is not the same as undoing the ungrouping of a phantom group :D

Craig`

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Still a beginner who doesn't know how to make a group.

Post by jacque » Mon Nov 20, 2023 10:25 pm

Sorry, I think it works mostly for deletions. At least that's what I've used it for when deleting a group accidentally. Not sure about scripted deletions though, I used it when accidentally hitting the delete key while a group was selected.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Still a beginner who doesn't know how to make a group.

Post by stam » Tue Nov 21, 2023 8:55 am

Well mostly that’s been a useful “feature” for me - it means I can ungroup, do stuff and re-group and it retains both the group name AND the group scripts automatically.

Your point is taken having said that, but not sure I’ve ever been bitten by this.

As for Undo - there surely can’t be a worse app on either MacOS or Windows than the LC IDE with respect to this.

It’s the one thing that never gets talked about… Undo works almost reliably in the script editor but when it comes to the IDE it’s a throwback to the 90s and a massive weakness of palette interfaces - or is it just me thinking I was deleting something in the message box but actually a control was topmost (even though the msgBox palette seemed like it was)? Bye-bye control and all your lovely scripts… no undo for you!

Why isn’t this talked about more?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Still a beginner who doesn't know how to make a group.

Post by richmond62 » Tue Nov 21, 2023 10:42 am

Ach: I gave up on 'undo' in LiveCode donkey's years ago, and that is why on big projects (such as my Devawriter) I have an inbuilt autosave + timestamp script that SAVES the thing every 90 seconds . . . Yes, it does clog up my "arteries", and at the end of the day I have to trash the odd 1000 files, but better that than ending up "in the soup" because of the lack of a consistent UNDO feature.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Still a beginner who doesn't know how to make a group.

Post by richmond62 » Tue Nov 21, 2023 11:04 am

One of the snags with HyperCard was that, as soon as you did anything it was saved.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Still a beginner who doesn't know how to make a group.

Post by dunbarx » Tue Nov 21, 2023 3:32 pm

One of the snags with HyperCard was that, as soon as you did anything it was saved.
Yep. Saved to disk every breath you took. Cost was a bit of time but the "backup" was oftentimes a godSend.

Is that written correctly? "godSend"?

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Still a beginner who doesn't know how to make a group.

Post by Klaus » Tue Nov 21, 2023 3:50 pm

dunbarx wrote:
Tue Nov 21, 2023 3:32 pm
...
Is that written correctly? "godSend"?
No idea, maybe ask a native english speaker? :-D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”