Page 2 of 2
Re: Wait command weirdness
Posted: Tue Jun 17, 2014 4:26 pm
by jacque
For what it's worth, the need to add an unlock screen in version 6.6.2 sounds like a bug to me. A brief wait with messages is supposed to allow an idle period where the engine does its housekeeping. That includes updating the screen, which isn't happening here.
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 12:21 am
by bn
For what it's worth, the need to add an unlock screen in version 6.6.2 sounds like a bug to me. A brief wait with messages is supposed to allow an idle period where the engine does its housekeeping. That includes updating the screen, which isn't happening here
OK, Jacque convinced me
reported as
Bug #12654
Kind regards
Bernd
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 1:47 am
by FourthWorld
Is this behavior evident in 6.7?
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 7:57 am
by bn
Is this behavior evident in 6.7?
No.
In 6.7 dp4 the repeat loop refreshes the screen without "wait with messages" or "unlock screen".
in 7.0 dp6 the repeat loop needs "wait with messages" only to refresh the screen. But if the field is unlocked and has a blinking cursor the insertion point draws incorrectly (mulitple times) as in pre 6.6.2.
Kind regards
Bernd
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 8:06 pm
by [-hh]
..........
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 8:36 pm
by bn
Hi Hermann,
your post made me look at this again.
What a surprise with or without "lock messages" in 6.6.2 my test stack ran without problem with or without "unlock screen".
The difference was that I did not have the project browser open.
And
simply opening the project browser screen update worked without "unlock screen"
BUT
once I display the card of the test stack in project browser I needed "unlock screen"
And now the weird part
If I have the project browser displaying the card of the test stack and I close the project browser by clicking into the red close button I still need "unlock screen"
The lesson for me is: test a bug without the project browser, just closing it might not be enough.
Could someone please confirm this behavior? Especially regarding project browser.
I attach my test stack
Kind regards
Bernd
Re: Wait command weirdness
Posted: Wed Jun 18, 2014 8:56 pm
by Simon
Mac os 10.9.2
LC 6.6.2
Inconsistently shows the problem.
But long long ago there was a posting about wait and the project browser I think. That is all I can remember about it.
Simon
Re: Wait command weirdness
Posted: Thu Nov 26, 2015 11:28 pm
by KimD
Dear all
Did this ever reach any form of resolution? I think that I'm experiencing the same with an animation that I've created.
On UpdateGraphicX
- Calculate the new location of GraphicX
- Lock Screen
- Change the points of GraphicX
- Unlock Screen
On AnimationIsGo
- Repeat while LetsGo is True
-- UpdateGraphicX
Button that toogles LetsGo between true and false, and calls AnimationIsGo when LetsGo is true
The above works fine, but my animation proceeds too fast so I need to slow it down. I add a Wait with messages command (I've tried varying the wait times) after the -- UpdateGraphicX command. Now my animation does ONE increment, then appears to stop; but when I push the toogle button to actually stop the animation - graphicX is redrawn in a location that shows that the new location has been calculated (but not displayed) many times.
After reading your forum entry - I add an unlock screen command immediately before the wait with messages command, and then everything works as it should (with the animation proceeding at an appropriate speed); but I don't understand why I needed what feels like an extra unlock screen command.
Livecode 7.06 on Windows
Thanks in advance
Kim
Re: Wait command weirdness
Posted: Fri Nov 27, 2015 12:16 am
by bn
Hi Kim,
it is hard to tell without the code you use. (the actual code, reduced to a minumum that shows the problem)
From your pseudo-code it should work.
The problem in this thread had mostly to do with Macs. Historically Macs did not update in a tight loop without a lock screen/unlock screen. Since the transition to Cocoa this has changed and now Mac behaves like Windows always behaved: you should not need a lock/unlock pair for display.
That said it is still wise to use lock/unlock when making more than one screen update in a dsplay handler. E.g. move grc to x,y, set the backgroundcolor of gr to xyz: that would be two screen updates without lock/unlock
Back to your original question why you need an additional unlock screen before "wait with messages" only your script could tell if it is in your script or a bug.
Kind regards
Bernd
Re: Wait command weirdness
Posted: Fri Nov 27, 2015 1:12 am
by KimD
Hi BernD
Hopefully - here it is. This is the first time I've tried to upload a file to the forum - please let me know if it doesn't work.
This code is now doing what I expected, but only after I inserted an "extra" unlock screen command (after reading the earlier comments in this post). I'm just curious as to why I need two unlock screen commands, when I've only got one lock screen.
Regards
Kim
Re: Wait command weirdness
Posted: Fri Nov 27, 2015 1:32 am
by bn
Hi Kim,
your code works for me using LC 7.1.1 RC4 on a Mac with or without blocking the line "unlock screen..."
Code: Select all
RotatePoly "GhostTooth1", "Tooth1", 180, 300, ggAngle
--Unlock screen // Why do I need this command ########################
wait 100 milliseconds with messages
So I don't know why you would need the extra unlock screen. There is nothing in your code that would explain it.
I would suggest that you download a more recent version of the 7.x.x series and test there.
http://downloads.livecode.com/livecode/
If you still need "unlock screen" then it might be something affecting LC 7.x.x and Windows.
That I can not test since I don't have access to a Windows Computer.
Tell us what you find out. If you still need unlock screen then please also mention your Windows version.
Maybe someone using Windows could chime in.
Kind regards
Bernd
Re: Wait command weirdness
Posted: Fri Nov 27, 2015 2:48 am
by KimD
Hi Bernd
Windows 7
On your suggestion I downloaded a more up-to-date version of Livecode. I'm now on 7.1.0, and the quirk of needing to enter the Unlock Screen command twice has disappeared.
Thanks AGAIN
Kim