Page 1 of 1
LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 3:50 am
by wmiriye
In my project, I have added another stack to place my pop up windows for my android app. When the pop up is loaded, it covers the whole screen and I don;t want that. When testing in LiveCode, it displays correctly, but when testing in in my android phone, the pop up window covers the whole screen.
How do I set it up in the script so that the modal windows do not cover the whole screen. but shows the background card a bit darker than the pop up window. Any help will be greatly appreciated.
Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 7:23 am
by richmond62
Have you defined the dimensions of your modal window?
In stack of modal window:
Code: Select all
on preOpenStack
set the width of me to 150
set the height of me to 100
end preOpenStack
-
-
Just a thought.
Mind you, as far as I know Android and iOS ONLY allow one window to be open at a time.

Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 9:56 am
by wmiriye
I tried changing the size on load but still not working....
Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 10:02 am
by mrcoollion
Maybe you could trick the situation with generating a PrintScreen and placing it as a background in the Modal Windows Stack?
Just an idea....
Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 10:19 am
by wmiriye
good idea, I wonder if I could take a screenshot at runtime and automatically make it the background of my modal window...I'll dig around on that.
I still don't understand why the size is not working on runtime. could it be my main stack settings are overriding the dimensions on my sub-stack?
Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 11:42 am
by Klaus
HI wmiriye,
THIS is the key:
richmond62 wrote: ↑Mon Jul 06, 2020 7:23 am
Mind you, as far as I know Android and iOS ONLY allow one window to be open at a time.

See above, that is the reason why every stack will be resized to cover the complete screen on mobile!
wmiriye wrote: ↑Mon Jul 06, 2020 10:19 am
I still don't understand why the size is not working on runtime. could it be my main stack settings are overriding the dimensions on my sub-stack?
You could fake it like this:
1. Create an opaque graphic in size of your stack/card
2. Set its blendlevel (optional)
3. Create a field and a button, and/or whatever you want to appear in your "modal window fake"
4. GROUP everything from 1 to 3
5. Hide this group
Now you can "open" the "fake" stack with:
You get the picture.
OR use the OS ASK and ANSWER dialogs.
Best
Klaus
Re: LiveCode Popup modal Window
Posted: Mon Jul 06, 2020 11:57 am
by wmiriye
Thanks Klaus, will do that. Too bad, one window shows up at a time.
Re: LiveCode Popup modal Window
Posted: Tue Jul 21, 2020 1:35 am
by wmiriye
Used groups and hide and showed them as pop ups. works nice.