Wait command weirdness

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Wait command weirdness

Post by jacque » Tue Jun 17, 2014 4:26 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Wait command weirdness

Post by bn » Wed Jun 18, 2014 12:21 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Wait command weirdness

Post by FourthWorld » Wed Jun 18, 2014 1:47 am

Is this behavior evident in 6.7?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Wait command weirdness

Post by bn » Wed Jun 18, 2014 7:57 am

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Wait command weirdness

Post by [-hh] » Wed Jun 18, 2014 8:06 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 2:17 pm, edited 1 time in total.
shiftLock happens

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Wait command weirdness

Post by bn » Wed Jun 18, 2014 8:36 pm

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
Attachments
display field in tight repeat loop.livecode.zip
(1.42 KiB) Downloaded 234 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Wait command weirdness

Post by Simon » Wed Jun 18, 2014 8:56 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Wait command weirdness

Post by KimD » Thu Nov 26, 2015 11:28 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Wait command weirdness

Post by bn » Fri Nov 27, 2015 12:16 am

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

KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Wait command weirdness

Post by KimD » Fri Nov 27, 2015 1:12 am

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
Attachments
TestGraphicCogsv2.zip
(2.58 KiB) Downloaded 260 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Wait command weirdness

Post by bn » Fri Nov 27, 2015 1:32 am

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

KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Wait command weirdness

Post by KimD » Fri Nov 27, 2015 2:48 am

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

Post Reply