screenUpdate - locks the actual screen

Here is where the magnanimous folks that create externals post them (.zip archives only please).

screenUpdate - locks the actual screen

Postby mrBean » Thu Mar 24, 2011 5:59 pm

Prevents drawing operations from being flushed to the screen for all windows belonging to the calling process. When you re-enable screen updates, the screen flushing for all windows belonging to the calling process appears to be simultaneous.
When a custom window is being resize, there is a flash white at the effected areas. Using screenUpdate will prevent the user from ever seeing that flash of white. This is a technique particularly useful for synchronizing parent and child windows. Make sure that the period after calling this function and before re-enabling updates is short; the system only allows updating to be disabled for a limited time (currently one second) before automatically re-enabling updates.

screenUpdate Sample.sc45.zip
Tested with sc471
(47.1 KiB) Downloaded 190 times
User avatar
mrBean
 
Posts: 89
Joined: Sat Jan 30, 2010 8:03 am
Location: New York

Re: screenUpdate - locks the actual screen

Postby codegreen » Thu Mar 24, 2011 6:28 pm

mrBean wrote:Prevents drawing operations from being flushed to the screen for all windows belonging to the calling process. When you re-enable screen updates, the screen flushing for all windows belonging to the calling process appears to be simultaneous.]

FWIW just be aware that this can confuse the update cycle inside SC. Unfortunately unlike hiding and showing the port pen (which is what lockscreen does) DisableScreenUpdates/EnableScreenUpdates is not additive, so SC internally tracks its count of Enables and Disables and balances them appropriately. If you go calling those Toolbox routines willy-nilly you can confuse it and throw drawing all out of kilter.

As long as you aren't wrapping calls to this external around any situation(s) where SC is calling these functions itself you won't have any problems. Even if you do mess up the internal lock count it won't hurt anything, but you may have to quit and relaunch SC to make things draw properly again...

HTH,
-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm


Return to XCmds, XFcns, and XRtns

Who is online

Users browsing this forum: No registered users and 1 guest