Page 1 of 1

Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 9:08 am
by joyocow
Hello everyone, I'm a new member

My stack has a button that allows me to show or conceal a substack that contains my app settings. When I first established the substack, the "show/hide" option functioned properly. I stopped LiveCode and returned to my project the following day. No matter what I do, I can't see the "Settings" substack. The message box indicates that it is visible and at a position where I should be able to see it. The height and breadth are accurate, but the substack is not visible, despite the live code indicating that it is.

I have four (4) controls in this substack. I can send a "mouseUp" to each of them, and the scripts make the appropriate adjustments to the main stack.

I erased the substack, established a new one, and everything worked perfectly. I saved my project, closed LiveCode, and reopened it. The exact same thing occurred again.

Any assistance would be appreciated.

Thanks,

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 10:18 am
by richmond62
Is it possible that there is some script in your main card that is hiding the substack?

ALSO: when one opens a stack, any substacks do not automatically open on the desktop, if you want your substack to show up when you open your main stack you will have to tell LiveCode to open it in the openStack script of your main stack a bit like this:

Code: Select all

on openStack
    open stack "mySubStack"
    set the visible of stack "mySubStack" to true
end openStack

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 2:03 pm
by dunbarx
Hi.

You are saying that your project worked perfectly and all you did was to quit LC (I assume everything was saved), reopen and the subStack would not appear? Is your stack available to post? If not, can you empty it of anything you do not want public and then post?

And if you agree, you will need to make, I think, ten other posts beforehand in order to qualify to post your file. Do that, and we will ignore them. Note that your stack file must be compressed in order to post it.

Craig

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 2:23 pm
by richmond62
Do that, and we will ignore them.
That could be seriously misinterpreted.

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 3:48 pm
by dunbarx
Gee, I hope Joyocow understands.

Joyocow, we promise not to ignore you once you pass the minimum posting limit. Just use the title "Test" for the next nine.

Craig

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 5:49 pm
by jacque
Visibility is a property of the stack and it will apply whether the stack is open or not. It has to be opened or shown before you actually see it. The visible of a stack is true by default so generally you don't need set it. Instead use "go" or "open" to bring it into focus where you can see it. Richmond provided an example of this.

Generally all you need is one line:

Code: Select all

go stack "settings" 

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 7:26 pm
by dunbarx
The OP stated that the subStack worked properly until LC was closed and then did not work in the new session. And this happened again with a rebuild of the subStack. Assuming there are no handlers somewhere that explicitly hide it, the very correct posts by Richmond and Jacque should not be pertinent.

I get that this all assumes we think we know what is going on here. :roll:

Anyway, joyocow, can you see what we are getting at? Frankly, I will bet that your project is doing this to itself; we just have to find where.

Craig

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 7:28 pm
by andresdt
Hi, other than making sure your substack is made visible. You can also make sure it is within the visible area of ​​the screen.

Code: Select all

set the loc of stack "settings" to screenLoc() // OR --> the loc of stack (main stack "settings" stack)
show card 1 of stack "settings"

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 9:17 pm
by dunbarx
Andre.

The OP writes:
The message box indicates that it is visible and at a position where I should be able to see it. The height and breadth are accurate, but the substack is not visible, despite the live code indicating that it is.
Seems to cover that, but we still need more definitive info.

Craig

Re: Error Cannot See A Visible Substack

Posted: Thu Jul 25, 2024 10:48 pm
by andresdt
:idea: Some other things that would be nice for the OP to check. Just to rule out that it is not an unwanted value of any of the following properties.

Code: Select all

set the blendLevel of stack "settings" to 0
set the windowShape of stack "settings" to 0

Re: Error Cannot See A Visible Substack

Posted: Fri Jul 26, 2024 9:24 pm
by stam
Failing a successful outcome based on the excellent advice above, if the issue persists please consider zipping it and sharing it directly on the forum. It may be easier to troubleshoot rather than trying to imagine what the issue is...

Re: Error Cannot See A Visible Substack

Posted: Fri Jul 26, 2024 9:46 pm
by richmond62
My nasty mind questions the reality of joyocow.

Or, as my late father used to say when he felt that things were going logically wonky, "How now, brown cow?"

I'm certainly waiting for the cows to come home. 8)

Re: Error Cannot See A Visible Substack

Posted: Sat Jul 27, 2024 9:23 am
by SparkOut
I'm wondering several things, but a couple of wonderings are around cleanup scripts on shutdown which might have done something to cause this, or my main suspicion is an openStack or preOpenStack handler in the main stack's stack script. If the substack opens but does not have its own openStack handler, this will be passed to the mainstack and trigger that (possibly hiding the substack). For this reason it's often recommended to put these handlers intended only for the mainstack into the card script of card 1