[Tutor] Timing errors

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Dec 16 19:05:18 EST 2003


> Could someone please educate me why this simple
> interface waits 10 seconds and then draws the rectangle??

I know zilch about livewoiires but...

>From livewires import *
Import time
begin_graphics()
move (500,100)
draw (550,100)
draw (550,250)
draw (500,250)
draw (500,100)
time.sleep(10)  <--- wait 10 seconds
end_graphics()  <-- finish graphics work so draw the result

This type of behaviour is fairly common in GUI graphics toolkits.
The
graphics often draw to a second screen buffer then when you
complete all the work it just swaps the displayed buffer with
the scratchpad. It makes for smoother screen updates.
Reversing the end_graphics and sleep calls should change the
behaviour. I assume that's what's happening in Livewire...

Alan G.




More information about the Tutor mailing list