hiding a group does not hide its members

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: hiding a group does not hide its members

Post by Klaus » Thu Nov 14, 2024 7:34 pm

dunbarx wrote:
Thu Nov 14, 2024 6:55 pm
Klaus.
Could you please give a little example where it is neccessary
to know about the effective visible of a control? Thanks!
I am adding functionality to a large project. I need to be able to show and hide certain groups, with each group owning several buttons.
OK.
dunbarx wrote:
Thu Nov 14, 2024 6:55 pm
Some of the buttons in each group are either hidden or shown when the group itself is shown, depending on other circumstances.
Ok.
dunbarx wrote:
Thu Nov 14, 2024 6:55 pm
But when a group is hidden, I was unable to access the child buttons using their "visible" property.
I really don't get why you want "to access the child buttons using their "visible" property" if the user does not see them anyway?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: hiding a group does not hide its members

Post by dunbarx » Thu Nov 14, 2024 7:43 pm

Jacque.
The current behavior makes it easy to show or hide whole sets of controls without disturbing the contents.
I still do not see how this might cause an issue. One would have to be doing the nonsense that I am to even notice the issue.

In other words, in hiding a group, how does a visible control with its visible property set to true, but now set to false along with the group, break anything? What scenario, assuming the "visible" property acted like its effective variant, would arise that would wreak havoc with the children of a group?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: hiding a group does not hide its members

Post by dunbarx » Thu Nov 14, 2024 8:04 pm

Klaus.
I really don't get why you want "to access the child buttons using their "visible" property" if the user does not see them anyway?
By "access" I meant do things to them, grab their contents for example. In a hidden group its child buttons were not really hidden since their visible was true. I could not access them via their "visible" property. But I can via their "effective visible" property.

The user oftentimes don't enter into it.

Craig

SparkOut
Posts: 2949
Joined: Sun Sep 23, 2007 4:58 pm

Re: hiding a group does not hide its members

Post by SparkOut » Thu Nov 14, 2024 8:56 pm

dunbarx wrote:
Thu Nov 14, 2024 7:43 pm
Jacque.
The current behavior makes it easy to show or hide whole sets of controls without disturbing the contents.
In other words, in hiding a group, how does a visible control with its visible property set to true, but now set to false along with the group, break anything? What scenario, assuming the "visible" property acted like its effective variant, would arise that would wreak havoc with the children of a group?

Craig
You have a group containg controls, some hidden and some visible. If you have the controls follow the setting of the patent group to visible being false then you would also expect all the child controls to have visible set true when you show the group again.
However, some of those controls should still be hidden.
Leaving the child controls' visible property untouched but inheriting the effective visible from the parent group means you don't need an arcane method of determining what their visible state should be in order to override the blanket setting to true suggested.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: hiding a group does not hide its members

Post by dunbarx » Thu Nov 14, 2024 9:48 pm

Sparkout.

Say we have a group with four buttons. Two have their visible property set to "true" and are visible. Two have it set to false and are invisible. We hide the group. All buttons are gone and all have their visible property set to false. Great.

OK, it is absolutely true and necessary that the group remember that two of the buttons were visible before the group was hidden, and that property must be restored if and when the group reappears. I assume that is the issue. If that is difficult to implement, then OK,

But if that was in fact the way LC worked, would there still be all this discussion? In other words, would that cause problems in the management of the children in groups that change their visible property? That if we only had the "effective visible" property life would be more difficult in general?

Anyway, I am with everyone else in that I certainly would not want any child properties to change in the process of hiding and showing a group. Just the opposite; I want the status quo to be remembered.


Craig

SparkOut
Posts: 2949
Joined: Sun Sep 23, 2007 4:58 pm

Re: hiding a group does not hide its members

Post by SparkOut » Thu Nov 14, 2024 10:01 pm

Then that's what the effective visible is for. I'm not sure what your question was now.
All buttons are gone and all have their visible property set to false. Great.
No...All buttons are gone and all have their effective visible inherited from the hidden group.

So the property of the child control doesn't change, and there's no need to restore anything. There's just inheritance, which can be overridden by specific property settings on the child.

I think.
I will probably shut up now because I'm confusing myself and wondering why visible false on the child overrides the visible true on the group for those controls we want to be hidden within the group, but visible true on the child doesn't override the visible false of the parent (even though we wouldn't want it to).

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: hiding a group does not hide its members

Post by dunbarx » Thu Nov 14, 2024 10:41 pm

I am going to shut up as well, with one last thought:

Would it have caused harm and trouble if from the start the "visible" property worked exactly like the "effective visible" property? Would anyone have noticed? I would not have in my work of a few days ago, because the buttons that disappeared when the group was hidden would have had that property which we shall not name read as "false".

I love this forum. :D

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: hiding a group does not hide its members

Post by jacque » Fri Nov 15, 2024 7:37 pm

dunbarx wrote:
Thu Nov 14, 2024 9:48 pm
Say we have a group with four buttons. Two have their visible property set to "true" and are visible. Two have it set to false and are invisible. We hide the group. All buttons are gone and all have their visible property set to false.
The button properties don't change when the group is hidden, so they don't need to be restored when it's shown. From a technical standpoint, the group simply isn't drawn on screen. That's why they can be unseen but their visible property is still true. I don't think inheritance plays a role here because each individual control already has its own setting.

Rarely, I've seen the same thing with whole stacks which are hidden but still "visible". I've had to issue a "show stack" command to see it. Meanwhile all the contents of the stack retained all their original property settings.

It does sound like the visible and effective visible may be logically reversed when a group is hidden. Effectively it's not seen but the property is still true. It probably should have been the other way around but the effective modifier was introduced later when it was too late to change things.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: hiding a group does not hide its members

Post by dunbarx » Sat Nov 16, 2024 6:05 am

Jacque.
It does sound like the visible and effective visible may be logically reversed when a group is hidden. Effectively it's not seen but the property is still true. It probably should have been the other way around but the effective modifier was introduced later when it was too late to change things.
OK. This whole thing started because it never occurred to me that hiding a group "hid" the child controls but did not actually hide them.

Again, I would think that a group should be smart enough to properly manage the visible of its members depending on the visible of the group itself, and have those properties behave "properly" in all states.

Interesting to me is that the "properties" property of such a control both before and after hiding its parent group are identical. I would have thought a week ago that the only way to do that would be to compare the properties property with and without another invisible control on top of it. Some sort of cloaking device. :wink:

Anyway, the effective visible works perfectly, given my thinking and druthers.

Craig

Post Reply