Eliminating the flicker from systemWindow

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
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Eliminating the flicker from systemWindow

Post by magice » Wed Jan 30, 2013 7:00 pm

On one of my stacks I have created a toggle button for the user to "Pin the stack to top". I used the systemWindow property to do this. I soon discovered though that if I perform an ask or answer command the dialog would be lost behind the stack. To overcome this problem, I threw in a line to toggle off the systemWindow before performing any tasks that require dialogs. The problem, is the flicker when this property is changed. Lock Screen does not help, (I assume because the change occurs to the stack and not within the stack) Is there any way to eliminate this flicker, or a way to have dialogs show above a system window so I can take out the the code that turns systemWindow to false?

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Eliminating the flicker from systemWindow

Post by shaosean » Thu Jan 31, 2013 2:09 am

The reason for the flicker is due to the re-creation of the window and not just setting the system flags.. You can get it flicker free through the use of externals, otherwise you might need to rethink it..

Steve Denney
Posts: 101
Joined: Wed Dec 22, 2010 8:17 pm

Re: Eliminating the flicker from systemWindow

Post by Steve Denney » Sun Feb 03, 2013 3:54 am

Hi, why don't you leave but return to the top-most stack & do whatever needs to be done there? (So it always stays on top)
Like so... you want cd gTheShownCd of stack gTheTopStak (both globals) to stay top-most.
You lock screen.
You go elsewhere, run scripts in another stack. You need an answer dialog in a handler?
Note: the code below assumes you’ve defined the variables mentioned above, locked screen and gone to some other stack (where you're in the middle of some handler)

Code: Select all

put the number of this cd into lCurrentCd // (could be global or local var)
put the name of this stack into lWorkStack // (again global or local var)
go cd gTheShownCd of stack gTheTopStak // this is the back drop you want the user to see
// if you have openStack or openCard handlers in the top-most stack you can set lockMessages to true before the transit & unlock (set to false) afterwards
unlock screen
answer info "Your question?" with option1 or option2 // etc
put it into lTheUsersAnswer //local var, or you might be able to leave the user's choice in 'it', depends on your code
lock screen // as before, now go back to whence you came
go cd lCurrentCd of stack lWorkStack // you might even be able to use a simple 'go back'
//handler keeps going, in a stack that's hidden by a locked screen and never shown...
Just remember to go back to the top-most stack at the end of every handler.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Eliminating the flicker from systemWindow

Post by magice » Sun Feb 03, 2013 7:19 am

I think I'll give that a try.

Post Reply