Page 2 of 2

Re: How to always close a substack when going to another substack?

Posted: Mon Oct 03, 2022 1:03 am
by FourthWorld
The comment from lead engineer Mark Waddingham two posts later in that thread seems to suggest "go...in window..." works on Android:

https://www.mail-archive.com/use-liveco ... 91689.html

Re: How to always close a substack when going to another substack?

Posted: Mon Oct 03, 2022 3:49 am
by jacque
"go...in window..." does work on Android and iOS, though I never saw the point in general since there is only one window at any time on mobile devices. The one exception might be when applying a visual effect to the stack change but if I remember right we can do that by going to the new stack normally. It's been a while since I tried it.

I don't think that changes the messages though. Once the stack is in memory it stays there until specifically closed. A workaround might be to specifically send an opencard or openstack message (or the name of the handler that does the work) whenever the stack changes. I usually prefer to send a custom message so it's clear that it wasn't sent by LC.

Re: How to always close a substack when going to another substack?

Posted: Mon Oct 03, 2022 11:04 am
by trevix
Your answers make me think that I may have constructed my standalone (a main invisible stack and lot of substacks, each one with several cards) in the wrong way. But I am not sure that avoiding substacks (only one main and its cards) could have solved my problems.
For my experience, on Android I had black screens (somehow everything went invisible, locking the standalone) and refresh problems.

In order to do some testing, I created the attached stack, to be tested on Android 11 hardware.
But I didn't get to the "substack" problem since, just using the main card, I found some inconsistent (in my opinion) behaviours.

Experiment 1 (only pressing "next"):
- the second card is not resized
- on the third card (that is resized and hide the stack) I keep seeing the 2nd card (resized) with the third (red) visible.
- the above does not happens anymore after the first reiteration.

- Experiment 2:
- you press the button that make the stack invisible, the effect is that everything gets locked. The card is still visible but I guess that the stack becomes invisible for what concern its controls. Very dangerous behaviour since a single script mistake, defacto freezes your standalone.

I guess that before start testing the "in Window", I must understand what is going on on the above...

Re: How to always close a substack when going to another substack?

Posted: Wed Oct 05, 2022 6:23 pm
by trevix
Hello.
Does anyone know why adding "in window" to a "do" command throws an error?

Code: Select all

do "go card tXX of stack tYY in window of this stack"
Just to explain what I am doing this, the text for the "do" arrives via socket and works fine without the "in Window".
"In window" almost solved all my problems...

Thanks

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 8:36 am
by trevix
Also... go card "XX" of stack "YY" in window of this stack does not work if run into a script that is called by send.

the script of stack ZZ:

Code: Select all

...
on GoToStack
  get the defaultStack --it = "ZZ" correct
  go card "XX" of stack "YY" in windows of this stack 
end GoToStack
this does not work and throws an error on "go card..." of stack ZZ:

Code: Select all

send "GoTostack" to stack "ZZ"
This work:

Code: Select all

Lock Screen
go card 1 of stack "ZZ"
send "GoTostack" to stack "ZZ"

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 8:42 am
by trevix
@Jacque
...there is only one window at any time on mobile devices...
Can you absolutely confirm this? Note that I am talking about "sub-stacks"...
For what I have seen on Android, having 2 opened substack,if the front substack has a reduced size then the back substack, this last is partially visible.
Same if the front substack is made invisible with script.

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 5:07 pm
by FourthWorld
What Jacque wrote is the wisdom handed down from on high. We're told that on mobile stacks are always rendered at the full device screen size, so that only one is visible at any given moment.

I haven't tried to open another stack and try to resize the top one smaller. It's interesting that you were able to do that. Given the guidance on this, I have to wonder about the implications, about useful ways to use multiple stacks on mobile. For example, I can envision some utility in being able to use two different stacks for the top and bottom of a display.

When the top stack was rendered, did it show a border or drop shadow around its edges?

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 7:22 pm
by jacque
If you aren't using fullscreenmode or scripting the resizing of the stack, then stacks are rendered at their natural size. A smaller one will appear to be drawn on top of the previously opened one.

Substacks are always in memory but there is only one actual window on mobile. I think what you're seeing is a redraw issue. LC only redraws the window content and leaves the areas around the window untouched. The larger stack window content will show around the smaller one.

This was an issue until it was fixed several versions ago, at least when using fullscreenmode. In your case you might have success if you set the backgroundcolor of the smaller stack to black or some other color. LC should use that to redraw the area around the edges. But the recommended solution is to resize all stacks to fit the current mobile screen.

I haven't tried that except in fullscreenmode mode but it's worth a try.

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 8:17 pm
by FourthWorld
jacque wrote:
Thu Oct 06, 2022 7:22 pm
I think what you're seeing is a redraw issue.
Damn. For a moment the possibilities were enticing.

Re: How to always close a substack when going to another substack?

Posted: Thu Oct 06, 2022 11:31 pm
by trevix

Code: Select all

 I think what you're seeing is a redraw issue
Yes. Apparently this is the thing (see attached stack).

By the way ,I decided to avoid the "in window" solution, since it is getting a lot of errors in the different situations I am having in my standalone.
In this demo stack I use instead a short command on the main stack ("CloseOtherStacks") and "r_" prefix on the stacks that need to be closed. This seems to work.
If you see a potential problem with this, please let me know.

Re: How to always close a substack when going to another substack?

Posted: Fri Oct 07, 2022 12:04 am
by jacque
FourthWorld wrote:
Thu Oct 06, 2022 8:17 pm
jacque wrote:
Thu Oct 06, 2022 7:22 pm
I think what you're seeing is a redraw issue.
Damn. For a moment the possibilities were enticing.
I suppose you could experiment with stacks that are half-height and carefully place them. The inactive one would basically just be an image but...? On the other hand, LC may decide to position any active window at the top-left of the screen, which wouldn't work at all. If you try it, let us know.

Re: How to always close a substack when going to another substack?

Posted: Fri Oct 07, 2022 2:04 am
by FourthWorld
Honestly, I can't think of any practical think I'd do with it that I couldn't do with groups. Tantalizing, but without purpose for me. Besides, these days all the mobile stuff I'm doing is web. Still using LC for desktop apps, where it shines brighter than any star.