lock screen gotcha revisited

Bob Sneidar bobsneidar at iotecdigital.com
Fri Aug 18 16:37:24 EDT 2017

Hi all. 

I have some screen updates I do that take time because I query a database first, and it may not be local. To keep the screen from progressively updating, I lock the screen. 

I then decided to put a status message field at the bottom of each "form" (meaning card in a stack) so I have a handler that I pass a message and a long card id to, and it sets the text of the field and the background color (for visual clue) so the user has some idea of what is going on. 

Now the first message I send works because I have not locked the screen yet. the SECOND message I send AFTER the screen is locked never appears, which is expected. So I have a script which checks for the lockscreen property and if true, unlocks the screen, waits 10 milliseconds (to make sure the screen updates) then relocks the screen. 

The problem is that it doesn't. Unlock the screen that is. I set a breakpoint in the condition that checks for the lockscreen property and it indeed DOES trigger, but without the breakpoint I never see the second status message. I even set the wait 10 milliseconds to 5 seconds and I STILL do not see the second message. 

Since the unlock screen is in a handler in a backscript, I do not think it is actually cancellign the lock set by the datagrid on the card. There was some discussion about this in the past, that not all lockscreens are created equal. Is there a way to tell how many screenlocks are current and who set the lock? I suppose I could track it in a property then send unlockscreen to everything that locked it, but I'd like to not have to do that. Better yet would be a global unlock screen that cleared all screen locks. I thought that wait would do it. I tried wait with messages. No dice. I also unlocked the screen 5 times in a row in case there were multiple screen locks (I didn't think it worked that way but it's cheap to test) still no luck. 

It seems one handler cannot unlock the screen when another locks it. 


More information about the Use-livecode mailing list