systemWindow, topLevel, palette stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

systemWindow, topLevel, palette stack

Post by SteveFI » Tue May 25, 2021 12:33 pm

Hello everyone,

I've almost finished my project and am now scratching my head over window layering.

My project needs to have its main window float above another application, which is some exam software that runs in kiosk mode. Half of the exam software's window is redundant (the practice software the examining body provides simply shows an "exam goes here" placeholder!) yet they would still like students to practise with the software. It's bit a silly if they can't actually see any exam papers to do so.

The simple solution is to float a window over the top using systemWindow, which is what my app does. This means they can have the exam we provide on the left and the remaining interface to create an answer on the right (it's masters-level, professional exam, case study, write a report, four hours long exam kinda stuff!).

Anyway, so far so good. However, one of the features I needed to implement is the ability to make notes on the exam paper. I've coded these to take the form of windows themselves (no titlebar, about 200 x 200 pixels in size) and want these to float above the main window.

Currently, all windows created have their systemWindow property set to true so they float above the exam software. However, because they all exist in the same layer, when the user interacts with the exam paper, it covers the note windows. I need the notes windows to sit on top of the main stack at all times.

I've tried using topLevel and palette on the note stacks but to no avail. When using palettes, I've tried setting raisePalettes to true but they still won't float over a system window.

Would anybody have any tips? I know this is a bit of strange one. I'm trying to overcome the limitations of someone else's application design!

Thanks,


Steve

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

Re: systemWindow, topLevel, palette stack

Post by Klaus » Tue May 25, 2021 1:07 pm

Hi Steve,

Code: Select all

...
go stack "the system window number 666"
...
will also bring a system window to front!


Best

Klaus

SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

Re: systemWindow, topLevel, palette stack

Post by SteveFI » Tue May 25, 2021 1:19 pm

Thanks Klaus.

Hmmm. I can bring the little notes windows to the front fairly easily. It's keeping them there that's proving to be tricky!

However, it also seems that depending on how I bring the notes to the front, they will stay there. Palette seems to present the windows without the main stack losing focus. It's when focus switches away and back to the main stack, it obscures all the palettes.

Perhaps I'll try trapping the resume event and cycle through the notes windows, bring them to the front without changing the focus. It may get a little flickery to the user but this isn't going to be a commonly used feature.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: systemWindow, topLevel, palette stack

Post by dunbarx » Tue May 25, 2021 2:31 pm

Hi.

Can you use the "resumeStack" message to bring the users "current" window to the front? Or even the "mouseEnter" message. placed in a backScript?

Craig

SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

Re: systemWindow, topLevel, palette stack

Post by SteveFI » Tue May 25, 2021 3:00 pm

Hi Craig,

Yes - I've used resumestack to trap the event, cycle through the palette windows (I've made them all mainstacks) and quickly bring them to the fore whilst retaining the focus in the mainstack. There is only a mild flicker as the windows draw, which is acceptable.

Thanks,


Steve

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: systemWindow, topLevel, palette stack

Post by dunbarx » Tue May 25, 2021 3:44 pm

Good.

Have you locked the screen when doing your "cycling? It may reduce that chatter.

Craig

SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

Re: systemWindow, topLevel, palette stack

Post by SteveFI » Tue May 25, 2021 5:58 pm

I hadn't as I didn't think that lock screen affected stacks, only their contents.

Still, it's worth a pop, isn't it? :D

Steve

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

Re: systemWindow, topLevel, palette stack

Post by jacque » Wed May 26, 2021 6:31 pm

Right, lock screen only affects the contents of a single window.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: systemWindow, topLevel, palette stack

Post by FourthWorld » Wed May 26, 2021 7:00 pm

When window layering is a concern, consider one window with expandable/collapsible parts.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

Re: systemWindow, topLevel, palette stack

Post by SteveFI » Thu May 27, 2021 10:47 am

Thanks yet again. :)

As expected, locking the screen didn't help. Fortunately, the students aren't expected to interact with the notes very often, so the flicker they experience is minor to the point of being trivial. I'm just a bit of a perfectionist.

Unfortunately, I'm having to mimic someone else's software to give the students exam practice so it's not really possible to change the UX. Having been through this process, there are a few things I'd change. :(

Steve

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”