Why is the geometry manager still borked in 2021?!

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: Why is the geometry manager still borked in 2021?!

Post by jacque » Sun Mar 14, 2021 11:57 pm

Good explanation for our readers here. Unfortunately, almost none of my apps are groups and rows, which usually deal with data display I think. But for those who do have layouts like that, this kind of scripting works well. LC can handle such a wide range of features that I'd be hesitant to categorize "most apps" as anything in particular, though many do match the example you provided. The little tool I mentioned a few posts above does use that type of layout and I scripted it as you would.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Davidv
Posts: 77
Joined: Sun Apr 09, 2006 1:51 am
Location: Australia

Re: Why is the geometry manager still borked in 2021?!

Post by Davidv » Mon Mar 15, 2021 12:06 am

richmond62 wrote:
Sun Mar 14, 2021 6:04 pm
I honestly wonder why the Geometry manager is still there as it's largely rubbish.

It should either be sorted out or dumped.
Given some say it works if used carefully, another option would be to explain its possible limitations or ideal usage at the top of the relevant tutorial. I noted that the tutorial mentions, well down the page, the GM and using resizeStack quite neutrally.

For the record, I don't use GM. In fact I rarely use resizeStack although I am at the moment. I have a situation where one rule is that at small scales two controls simply disappear in favour of an essential field, rather than being repositioned.The outcome is quite similar in approach to Richard's text editor example, although with far fewer objects plus the disappearing trick.

Regarding the general context, I recall being party to list discussions long ago on debugging vs features, yet Livecode is still going and may yet outlive me. :)

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

Re: Why is the geometry manager still borked in 2021?!

Post by richmond62 » Mon Mar 15, 2021 8:41 am

another option would be to explain its possible limitations or ideal usage at the top of the relevant tutorial
Indeed.

Another option would be to have it explained comprehensively in the Dictionary.

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Why is the geometry manager still borked in 2021?!

Post by tetsuo29 » Mon Mar 15, 2021 6:09 pm

richmond62 wrote:
Mon Mar 15, 2021 8:41 am
Another option would be to have it explained comprehensively in the Dictionary.
And, yet, another option would be for LC just fix it. I'm pretty sure it's long overdue at this point.

EDIT:
I've filed a bug report and I would encourage anyone else who thinks it's high time that the GM got fixed in LC to please go add comments to it. Thx.

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

Re: Why is the geometry manager still borked in 2021?!

Post by dunbarx » Mon Mar 15, 2021 10:32 pm

New LC users are attracted right away to cool sexy gadgetry, like the dataGrid. That is stable, but usually a distraction for them, since it has it own learning curve, and I fear disheartens those users who miss the opportunity of grokking the beauty and ease of use of LC itself.

I agree that it is very dangerous and embarrassing to offer a prepackaged tool that is not stable, or at least who's limitations are not explicitly stated.

I remember when HC was losing ground to increasing modernity around the turn of the century. But it is essentially the same problem, the perception that the product is not professional.

I would be much happier if the table field was fixed. That is a much more "basic" control. I never use the GM, and would not miss it. I have to give each and every table field a vaccine before I can trust it:

viewtopic.php?f=7&t=31452&p=170731&hili ... ly#p170731

Craig

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Why is the geometry manager still borked in 2021?!

Post by tetsuo29 » Tue Mar 16, 2021 12:23 am

dunbarx wrote:
Mon Mar 15, 2021 10:32 pm
I would be much happier if the table field was fixed. That is a much more "basic" control. I never use the GM, and would not miss it. I have to give each and every table field a vaccine before I can trust it:

viewtopic.php?f=7&t=31452&p=170731&hili ... ly#p170731

Craig
Yeah, I guess we all want the thing we used fixed. I don't use tables so, I hadn't run across it. But, honestly, I'd be happier if they BOTH were fixed. The fact that they are not is extremely perplexing and irritating to me.

Makes me feel that the text on this web page is pretty bogus:
We take quality very seriously. If you are encountering an issue with LiveCode, we recommend submitting a bug report in our quality control center.
Like, how can they claim they take quality "very seriously" when they let these verified bugs go unfixed for years?

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Why is the geometry manager still borked in 2021?!

Post by bwmilby » Tue Mar 16, 2021 1:00 am

I am probably the last person to post a fix to the GM. The initial issue almost seemed like a problem caused by the issue that was fixed (the object count got off when adding so references were not calculated correctly for new objects). Even before that code fix it was easy to avoid by manually caching control metrics.

One thing about resize code, you can break things just as bad with a hand coded resize handler. You should always save your stack before allowing any resize handler to fire. I’ve learned that lesson more than once.

For what it does, I think it works well enough. I don’t find it robust enough for most work though. As soon as you can leverage groups of objects and have them adjust themselves you are going to quickly move past GM.

The library that I wrote for Jacque is mainly a somewhat streamlined and manual GM. You run a handler that captures metrics of controls and then the resize handler adjusts them based partly on captured data.

I could do some additional work on the GM, but I would need some fairly targeted issues to tackle.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Why is the geometry manager still borked in 2021?!

Post by tetsuo29 » Tue Mar 16, 2021 1:27 am

bwmilby wrote:
Tue Mar 16, 2021 1:00 am
For what it does, I think it works well enough.
I don't even know how you can say this based on what I (and others are saying). Add a new object to a card, and suddenly when the stack is resized, objects that scale, scale to insanely large sizes (beyond the new bounds of the stack size) and objects that move, move far beyond the new bounds of the stack. This is definitely not "working well enough." It's horrid.
I could do some additional work on the GM, but I would need some fairly targeted issues to tackle.
Ok, how about the ability to add new objects to a card and have the existing objects continue to resize as expected?

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Why is the geometry manager still borked in 2021?!

Post by bwmilby » Tue Mar 16, 2021 1:46 am

I can't reproduce that problem. I just created a stack, added 3 widgets. First one pinned right, second pinned right/top, third scaled width. Resize works fine. Dragged 3 additional widgets and everything worked correctly.

Also, which version of LC? I tested 9.6.2rc2
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Why is the geometry manager still borked in 2021?!

Post by tetsuo29 » Tue Mar 16, 2021 12:27 pm

bwmilby wrote:
Tue Mar 16, 2021 1:46 am
I can't reproduce that problem. I just created a stack, added 3 widgets. First one pinned right, second pinned right/top, third scaled width. Resize works fine. Dragged 3 additional widgets and everything worked correctly.

Also, which version of LC? I tested 9.6.2rc2
Wow. Just. Wow. This is like watching Chief Wiggam investigate a crime on the Simpsons. Well, if this is indicative of how LC “takes quality seriously” then, I guess it’s a perfectly candid demonstration of how massively untrue that statement is. No wonder this issue (and a few others) has never been (and probably never will be) fixed. Thank you for providing a real world demonstration of how “seriously” LC takes quality, it may not have been helpful but, it’s been very enlightening.

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Why is the geometry manager still borked in 2021?!

Post by bwmilby » Tue Mar 16, 2021 12:45 pm

I am just a user like you in most respects. All code that I’ve put into the project via PR is purely donation work. What version did you test? What you describe does not make sense with how the GM works so I am missing a step somewhere. Adding an object to a card should not update any other object geometry.

You provided a recipe that I tried and did not work. Recipes are how we identify bugs to fix them. To expect the team to execute a recipe that does not work and fix a problem they don’t see manifest is a stretch.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

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

Re: Why is the geometry manager still borked in 2021?!

Post by stam » Tue Mar 16, 2021 12:48 pm

bwmilby wrote:
Tue Mar 16, 2021 1:46 am
I can't reproduce that problem. I just created a stack, added 3 widgets. First one pinned right, second pinned right/top, third scaled width. Resize works fine. Dragged 3 additional widgets and everything worked correctly.

Also, which version of LC? I tested 9.6.2rc2
Hi Brian,

I'm afraid i don't share your experience either, using 9.6.2 RC2.

I attach a test stack with a button, a datagrid and group consisting of a rect+field.
The datagrid is meant to to move with the right edge and lengthen as needed.
The group is mean to stick to the bottom&right edge
The button is mean to stick with the bottom edge and change length with the stack.

When i resize the stack, there is a momentary tiny 'jump' in all controls and then nothing.

By all means please do let me know what i've done wrong here...

Many thanks
Stam
Attachments
GM test.livecode.zip
(6.08 KiB) Downloaded 163 times

Thunder
Posts: 20
Joined: Thu Mar 12, 2015 1:52 pm

Re: Why is the geometry manager still borked in 2021?!

Post by Thunder » Tue Mar 16, 2021 1:28 pm

Hi !

Has anybody tested this ?

https://github.com/dagirard/NativeGeometry
'

tetsuo29
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 103
Joined: Thu Jun 07, 2007 1:30 am

Re: Why is the geometry manager still borked in 2021?!

Post by tetsuo29 » Tue Mar 16, 2021 1:29 pm

bwmilby wrote:
Tue Mar 16, 2021 12:45 pm
To expect the team to execute a recipe that does not work and fix a problem they don’t see manifest is a stretch.
'I added 3 things and the problem did not manifest itself. Should, I add a 4th? A 5th? A 6th? Nah. I've proved there's no problem.'

So, I just downloaded 9.6.2-rc-3 on macOS Catalina. (I had been using 9.6.1 on Win 7.) I created a new stack. No other stacks open. No other instances of LC running.

I made the stack larger. I added a scrolling field to the stack and made it take up about 3/4 of the space. Set it to resize on the right and bottom, anchored to the stack. Resized the stack. Worked.

I added a label and a field just above the scrolling field on the left side of the window. Then I added standard button, also above the scrolling field, but, all the way to the right side of the window. I set this new button to resize (I actually meant to have it change position but, made a logical error) anchored to the right side of the stack/window. Resized the stack. Bam. Both the scrolling field and the newly added button resized themselves far outside of the stack's new boundaries.

This was not a complicated layout. I was only on my 4th newly added element. I had sat down with the intention of adding elements and keeping count of how many I needed to add in order for the bug to manifest itself. I got to 4.

I will save this stack and upload it. I will also provide a screen capture showing the two elements have resized themselves outside of the bounds of the stack.

Image
Attachments
Geometry Manager Insanity.livecode.zip
(1.3 KiB) Downloaded 176 times

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Why is the geometry manager still borked in 2021?!

Post by bwmilby » Tue Mar 16, 2021 2:23 pm

Now that I see your actual recipe, I have reproduced the issue. One way to avoid the issue until fixed is to issue

Code: Select all

revcachegeometry true
In the message box before resizing after adding controls.
What I observed is that the cache distances were incorrectly updated when a control was added. When resizing, it uses the cached metrics so that is why it went wonky. The problem is not in the GM resize script, but in the IDE/GM cache setup. I don't have time to look at it now, but will try to see if I see anything this evening.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Talking LiveCode”