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

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

hiding a group does not hide its members

Post by dunbarx » Wed Nov 13, 2024 8:29 pm

BOY DID THIS throw me for a while.

Hiding a group of controls hides the group but not the child controls of that group. The visible of the group is "false". The visible of the children are "true". You cannot see those controls, but their visible is nonetheless "true".

Is there a property where the visible is true but the "visible" is false?

Everyone but me knew that???

Craig

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

Re: hiding a group does not hide its members

Post by Klaus » Wed Nov 13, 2024 8:40 pm

Hi Craig,

sorry, don't get your problem?
Hiding a group will of course also hide its "content", no matter if the controls inside of the group are visible or not.



Best

Klaus

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 » Wed Nov 13, 2024 8:43 pm

Ah. There is always the "showInvisibles" property. The dictionary states:

"Specifies whether invisible objects are shown anyway."

"Anyway"...

and

"Invisible objects that are temporarily shown with the showInvisibles property respond to mouse clicks and key presses as though they were visible.

"Visible"...

So there is a, er, gray area where invisible controls can be made visible. Hmmm, is that anything like setting their visible property to "true"? Yes it is. But that is not the same as having their visible property set to true, but still not seeing anything.

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 » Wed Nov 13, 2024 8:47 pm

Klaus.

Code: Select all

Hiding a group will of course also hide its "content", no matter if the controls inside of the group are visible or not.
If I hide the content, I expect the "visible" property of that content to be "false", not true. Don't you?

I wanted to deal with the visible controls differently than the hidden ones. So after hiding the group that contained certain buttons, I stupidly wrote a handler:

Code: Select all

 repeat with y = 1 to the number of btns
 if the visible of btn y then do stuff to btn y
And what do you know? The hidden buttons all were subjected to having stuff done to them.

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 » Wed Nov 13, 2024 8:54 pm

Klaus.

So say I have a card with four buttons. I group two of them and then hide that group. Can you suggest an easy way to act on the visible buttons but not the, um, er, you know, invisible ones?

Do I need a new property, the "cantActuallySeeButStillNonethelessVisibleIsTrue" property?

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 » Wed Nov 13, 2024 8:59 pm

Unless I have this completely wrong, I will have to not simply hide the group, but rather move it off the card. Then the only visible buttons in play will be the ones that are actually visible.

Craig

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

Re: hiding a group does not hide its members

Post by Klaus » Wed Nov 13, 2024 9:02 pm

dunbarx wrote:
Wed Nov 13, 2024 8:47 pm
Klaus.

Code: Select all

Hiding a group will of course also hide its "content", no matter if the controls inside of the group are visible or not.
If I hide the content, I expect the "visible" property of that content to be "false", not true. Don't you?
No, I don't!
Their VISIBLE property is still TRUE, but we cannot see them, so I still don't get your problem.

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 » Wed Nov 13, 2024 9:02 pm

I am posting a la Richmond.

Since moving them off the card is a real pain to manage I will set a custom property of each before hiding, and use that as a way to distinguish certain visible buttons from other certain visible buttons.

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 » Wed Nov 13, 2024 9:07 pm

No, I don't!
Exclamation point?

But why? They are invisible buttons (at least to my eyes) that have their visible property still set to "true". I want to distinguish them from their, er, visible brethren when running another process.

The custom property will do the job, though unnecessarily complex. I suppose I could also not deal with any control that is owned by an invisible group.

You do not agree this seems odd? :?

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 » Wed Nov 13, 2024 9:14 pm

Klaus,

I see your addition to your post. Recall I wrote earlier:
So say I have a card with four buttons. I group two of them and then hide that group. Can you suggest an easy way to act on the visible buttons but not the, um, er, you know, invisible ones?
I thought I could use the visible property to do that.

Nope.

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 » Wed Nov 13, 2024 9:17 pm

Klaus.
Their VISIBLE property is still TRUE, but we cannot see them,
I know you are not joking. I cannot understand why. :?

Craig

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

Re: hiding a group does not hide its members

Post by Klaus » Wed Nov 13, 2024 9:23 pm

This is how LC works and may differ from real life! 8)

Imagine it would be as you see it, then we would need to set the visible of ALL controls in the group to visible again,
but LC does this for us by ALSO hiding all controls when hiding the group but NOT changing their VISIBLE property.

So this behavior is completely logical to me.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: hiding a group does not hide its members

Post by bn » Wed Nov 13, 2024 9:56 pm

Craig,

try

Code: Select all

put the effective visible of button 1
tested in 10.0.0 RC1

Kind regards
Bernd

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

Re: hiding a group does not hide its members

Post by Klaus » Wed Nov 13, 2024 10:13 pm

"the effective visible"!!?
Go figure! :-D

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

Re: hiding a group does not hide its members

Post by SparkOut » Wed Nov 13, 2024 11:20 pm

Ha, I was reading through this thread and starting to scroll through with the thought "I wonder if it's worth asking to check for the 'effective visible' of an object to test inheritance?"
Turns out it is! and was answered by the time I got to the bottom of the thread. (Or before, I mean it's not like I was reading at the same time as Bernd and Klausimausi posting.)

Post Reply