LiveCode Popup modal Window

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

LiveCode Popup modal Window

Post by wmiriye » Mon Jul 06, 2020 3:50 am

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9380
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LiveCode Popup modal Window

Post by richmond62 » Mon Jul 06, 2020 7:23 am

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
-
Screenshot 2020-07-06 at 9.29.42.png
-
Just a thought.

Mind you, as far as I know Android and iOS ONLY allow one window to be open at a time. :?
Last edited by richmond62 on Mon Jul 06, 2020 10:16 am, edited 1 time in total.

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Re: LiveCode Popup modal Window

Post by wmiriye » Mon Jul 06, 2020 9:56 am

I tried changing the size on load but still not working....

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: LiveCode Popup modal Window

Post by mrcoollion » Mon Jul 06, 2020 10:02 am

Maybe you could trick the situation with generating a PrintScreen and placing it as a background in the Modal Windows Stack?
Just an idea....

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Re: LiveCode Popup modal Window

Post by wmiriye » Mon Jul 06, 2020 10:19 am

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?

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: LiveCode Popup modal Window

Post by Klaus » Mon Jul 06, 2020 11:42 am

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:

Code: Select all

...
show grp "my fake stack"
...
You get the picture.

OR use the OS ASK and ANSWER dialogs. :-)


Best

Klaus

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Re: LiveCode Popup modal Window

Post by wmiriye » Mon Jul 06, 2020 11:57 am

Thanks Klaus, will do that. Too bad, one window shows up at a time.

wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

Re: LiveCode Popup modal Window

Post by wmiriye » Tue Jul 21, 2020 1:35 am

Used groups and hide and showed them as pop ups. works nice.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”