Dialog box opens up behind systemWindow stack

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
raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Dialog box opens up behind systemWindow stack

Post by raugert » Fri Jun 01, 2018 5:44 am

Note: I changed the title of the post for better clarity... I hope it ok..

I use the "systemWindow" command to keep my stack on top of other applications. When I open a dialog box like "answer file" or answer "yes" "no" to quit, the dialog box appears behind my application window. So to bring the dialog box to the front, I temporarily issue a systemWindow False command to my stack, but I get a "screen flash" when doing this. Is there another way to bring the dialog boxes to the front and leave the systemWindow true so I don't get the screen flash ? This only happens on Windows platform and not on Mac.

Code: Select all

case "Quit" 
         lock screen
         if the hilite of button "Always On Top" is true then set the systemwindow of stack "vMIx Panel Builder" to false
         answer "Do you really want to quit?" with "No" or "Yes"
         if it is "Yes" then
            send "quitMyProject" to stack "myApp" in 0 millisecs
         end if
         set the systemwindow of stack "myAppr" to hilite of button "Always On Top"
         unlock screen
         break
Last edited by raugert on Fri Jun 01, 2018 11:57 pm, edited 3 times in total.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

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

Re: set 'systemWindow' flashes when it changes state

Post by richmond62 » Fri Jun 01, 2018 6:46 pm

I wonder why your dialog box is appearing behind the main stack:
is it a home-made dialog rather than the standard one built into LiveCode?

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: set 'systemWindow' flashes when it changes state

Post by raugert » Fri Jun 01, 2018 8:44 pm

No, it's the standard Livecode dialog box. It only happens when I set systemWindow of my stack to true. Otherwise it appears in the front as normal.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7235
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dialog box opens up behind systemWindow stack

Post by jacque » Sat Jun 02, 2018 6:03 pm

A system window floats over everything else so it's to be expected that a dialog will appear behind it. When you change a window style, LC must destroy the old window and create a new one, which is why you see the flash. There is no way to ask the OS to change the style of an existing window, it has to be created new. A lockscreen won't help because screen locks only apply to the current window, and that one is about to be destroyed.

The only workaround I can see is to use a group in the system stack instead of a dialog. In other words, do everything inside the system window.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: Dialog box opens up behind systemWindow stack

Post by raugert » Sun Jun 03, 2018 2:19 pm

Thank-you jacque,

That is a great explanation. I could easily create a group for a simple yes/no dialog, but when I ‘open or save’ a file, I use the “answer file” dialog. That would be more complicated to create from scratch. I think I’ll live with the flashing in that case..

Thanks for your help,
Richard
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Dialog box opens up behind systemWindow stack

Post by jmburnod » Sun Jun 03, 2018 2:44 pm

Hi Richard,
That would be more complicated to create from scratch
Yes, if you want save to/ open from anyplace.
You may decide for one destination/source folder in documents folder or in the folder of your app to save/open file without answer/ask file.
Best regards
Jean-Marc
https://alternatic.ch

karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: Dialog box opens up behind systemWindow stack

Post by karmacomposer » Mon Apr 27, 2020 8:42 pm

I am having the same problem.

In Windows 10, everything works perfectly in the editor. However, after building, ask and answer dialogs are hidden or behind other items in the stack.

How can I fix this? I need answer and ask dialogs to appear like they should.

I can't seem to find anything in the build options that would fix this.

Thank you for any help.

Mike

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7235
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dialog box opens up behind systemWindow stack

Post by jacque » Tue Apr 28, 2020 4:16 pm

Nothing has changed since the first responses. A system window floats above everything else, that's its purpose. Try the suggestion above, setting it to false before showing a dialog.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9834
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Dialog box opens up behind systemWindow stack

Post by FourthWorld » Tue Apr 28, 2020 6:14 pm

Are there examples of apps from major vendors in which systemWindow-level windows are in front of dialogs opened from such a window?

True, systemWindow is designed to have a window above all others.

But modal dialogs are also designed to be above all others. And given their role, it seems reasonable that a modal dialog opened from any window - even a palette, even with systemWindow true - would be in front of the window invoking it.

I'd flag this as a bug.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”