Best Practice for updating the screen?

Richard Gaskin ambassador at fourthworld.com
Tue May 23 17:18:55 CEST 2017


Screen redraws should be controllable by the scripter with lockScreen.

The need to use "wait 9 with messages" was recognized as a bug, and IIRC 
fixed in more recent versions of LC (v7 and later?).

If you find remaining cases where your script does not have control over 
redraws with "lock screen" and "unlock screen" please file a bug report.

-- 
  Richard Gaskin
  Fourth World Systems


Paul Dupuis wrote:

 > I find on many occasions that I am in the middle (or somewhere) in a
 > long handler and I want to update the screen and then continue.
 >
 > Example:
 >
 > on something
 >   lock screen
 >   ... bunches of code
 >   unlock screen
 >   wait 0 with messages -- generate a screen redraw/update to display
 > something (status message/icon/symbol/whatever
 >   lock screen
 >   ... more bunches of code
 >   unlock screen
 > end something
 >
 > The problem with this approach is that other messages can get through in
 > addition to the OS redrawing the screen, such as an impatient user
 > generating key down or auto key or mouse events.
 >
 > I realize I could use "flushEvents" before the "wait 0 with messages"
 > statement to clear any such impatient messages out, but is there a
 > better way?
 >
 > Has LiveCode ever considered a "redraw screen" command or something like
 > that which lets the system have some free CPU cycles but without other
 > UI events getting processed?
 >
 > Is there an enhancement request for such a feature in the LiveCode
 > bugzilla database?
 >
 > Does anyone else run into this issue in their work?
 >
 > What is the "best practice" for this issue?




More information about the use-livecode mailing list