Page 1 of 1
set the visible property of a group in script
Posted: Mon Oct 24, 2022 9:31 am
by joaoserras
Hi.
On my interface I need to set the visible property of a group after clicking a button.
My code is:
Code: Select all
on mouseUp pButtonNumber
-- set the visible of grp "grp_control_panel" to true
go to card "base_form"
end mouseUp
but it does nothing... the group stays invisible... can anyone help?
Re: set the visible property of a group in script
Posted: Mon Oct 24, 2022 9:56 am
by richmond62
If you remove the '--' at the front everything should work.
Re: set the visible property of a group in script
Posted: Mon Oct 24, 2022 2:01 pm
by dunbarx
Hi,
Richmond zeroed in on what seems to be the problem.
But I assume that in your post, the "--" comment tag was not really in your handler. After all, you did write that very line, which on its own would have done exactly what you asked for here.
In other words, is something else going on?
Craig
Re: set the visible property of a group in script
Posted: Mon Oct 24, 2022 2:03 pm
by dunbarx
Maybe you did not know that "--" denotes a comment, and anything following will be ignored?
Craig
Re: set the visible property of a group in script
Posted: Mon Oct 24, 2022 5:27 pm
by RCozens
Hi,
I'm assuming you originally tried your script without the "--".
Have you previously set the visibility of individual controls in the group? Any control whose visibility property is set to false will not become visible when the group visibility is set to true.
See the attached stack. It has a group of three images that can be shown or hidden by the click of a button; but there are also buttons to show & hide one of the images. If that image is hidden, it will not be visible when the group visibility is set to true.
The converse is not true: setting a grouped control's visibility to true will not make it visible if the group's visibility is false.
Cheers!