What happen with function screenloc() and screenrect()?

Jeanne A. E. DeVoto revolution at jaedworks.com
Wed Mar 29 23:13:41 EST 2006

At 2:19 PM -0500 3/29/2006, Gilberto Cuba wrote:
>I am found that functions screenloc() and screenrect() not work fine 
>or I don't understanding the documentations.
>Occur that I change the resolution when my application start and I 
>tried to center the software with
>set the loc of this stack to screenloc()
>this not work fine. Why? I found that function screenloc() and 
>screenrect() keep the values of the last resolution and not refresh 
>with the new display resolution.

Yes, all of the screen functions behave like this (screenLoc, 
screenRect, windowBoundingRect, colorMap, colorWorld, screenType). 
They are set only when the application starts up, and they are not 
updated if you change the settings. As it says in the docs for 
screenRect: "The value returned by the screenRect function is updated 
only when you start up the application. If you change the screen 
settings after starting up the application, you must quit and restart 
to update the screenRect."

The best way is probably to create your own function. If you are 
setting the resolution, then you know what the new resolution is, and 
you can place the new value in a global variable. Then use that 
instead of the built-in screenLoc or screenRect.
jeanne a. e. devoto ~ revolution at jaedworks.com

More information about the Use-livecode mailing list