Grouped objects limit?

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

Post Reply
jmk_phd
Posts: 213
Joined: Sat Apr 15, 2017 8:29 pm

Grouped objects limit?

Post by jmk_phd » Wed Jun 01, 2022 3:30 am

Last summer I published a freeware Win/Mac music app with a fixed window size of 1076x716, every pixel of which was needed to squeeze everything – several hundred objects – into that available space. Stupidly – until enlightened just today by a very polite user – I’d overlooked that for folks using 12- or 13-inch laptops the bottom vertical inch or so of the window would be cut off and impossible to view.

My first thought was this: (1) Group the entire contents of the card into a single mega-group; (2) Add to that mega-group a vertical scrollbar; (3) in the preOpenStack identify the working screenRect and allow the vertical dimension of the window to resize accordingly. My assumption was that the group scrollbar would kick in when the height of the resized window was less than the height of the group.

Inasmuch as the stuff at the bottom of the window are real-time animations on a piano keyboard of the notes being sounded, needing to scroll down to view these is far less than ideal.

Yet here’s the thing: When I try to group the entire contents of the card, LC 9.6.7 balks with a beep and refuses to create the group.

So does anyone know whether there is a limit to the number of objects (some of which are already in subgroups) that can be grouped on a single LC card? Otherwise, I don't know how to enable scrolling the entire contents of the card window to accommodate smaller screens.

I suppose that I could create a separate miniaturized version for folks with 12-/13-inch screens, but I seriously doubt that there's enough demand to warrant the hassle of redesign and code-signing. So for now, I’ve just added a note to the download website that a 15-inch screen is required.

jeff k

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Grouped objects limit?

Post by FourthWorld » Wed Jun 01, 2022 6:56 am

Unless you have many thousands of objects, I don't think it's the object count.

More likely, perhaps you had Select Grouped Controls active and the beep was because attempting to group the selected objects would break existing group membership?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Grouped objects limit?

Post by jmburnod » Wed Jun 01, 2022 8:11 am

Hi jeff,
Do you have shared or background behavior group among your controls ?
If that is the case you can't insert them in a group.
Best regards
Jean-Marc
https://alternatic.ch

andresdt
Posts: 146
Joined: Fri Aug 16, 2019 7:51 pm

Re: Grouped objects limit?

Post by andresdt » Wed Jun 01, 2022 5:06 pm

Something similar has happened to me when I have the selectGroupedControls property active.
So my suggestion is to check that the selectGroupedControls property is false.

Code: Select all

put the selectGroupedControls
If you have a group on the card, check that it has the selectGroupedControls property set to false.

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

Re: Grouped objects limit?

Post by jacque » Wed Jun 01, 2022 5:28 pm

Rather than a scrollbar, look at the scalefactor function, which actually popped up in another thread today. It was created to accommodate laptops as you describe, and it's only one line of code. It works well. We found that a scalefactor of .75 worked well for laptops.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmk_phd
Posts: 213
Joined: Sat Apr 15, 2017 8:29 pm

Re: Grouped objects limit?

Post by jmk_phd » Wed Jun 01, 2022 10:58 pm

Thanks for everyone’s feedback!

The suggestions to examine the selectGroupedControls property actually led me to track down why I was unable to group the entire contents of the stack window.

Turns out that the “Select All” command includes not only every object visible on the card, but also the Menu group that on a Mac is hidden behind the title bar. Once I spotted this and instead selected the window items manually so that the Menu group was excluded, the entire contents of the window grouped successfully.

An important lesson learned. (Still, for what it’s worth, it seemed not to matter whether for some groups the selectGroupedControls was set to true.)

In any case, grouping an entire window in order to provide a vertical scrollbar was an inferior last-resort solution to the problem of a stack window exceeding the size of a small laptop screen.

Jacque has mentioned a far better solution: the scaleFactor property, which can reduce the size of the window without altering its appearance in any other way. (Earlier last night another helpful forum member sent me a private message with the same tip, suggesting also that I determine the vertical screenRect in order to calculate the optimal scaleFactor.) This seems to work flawlessly.

I might need to experiment a bit in order to ensure that the window is still centered on screen. But enabling my freeware app to accommodate smaller laptop screens is worth the effort of hassling with code-signing new installers.

jeff k

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”