Two questions
Richard Gaskin
ambassador at fourthworld.com
Mon Nov 10 16:17:33 EST 2003
Thomas J McGrath III wrote:
> You see getting the screenRect is one thing but knowing when the
> screenRect is changed is what I want. I would prefer not to run a loop
> all of the time checking and waiting for the user to change it.
How often will your users change their resolution?
FWIW, spot-checking the behavior elsewhere I find that Outlook Express,
Mozilla, and even the 10.2.8 Finder do not account for resolution reduction
dynamically, and I suspect many other apps don't either. At least you're in
good company. ;)
If there's a reason to believe customers of your app will be unusually prone
to adjusting their resolution during their session with your app (that rules
out most Win users since most of the ones I've supported have never seen
their Display control panel <g>), polling on one-second intervals should
cover what you need without a noticeable decrease in performance.
In fact, it turns out to be barely measureable: to respond to a message and
check the screenRect takes about 0.037ms on my old 500MHz G4 (testing script
copied below).
While you're at it, it might be useful to Bugzilla an enhancement request
for a new resolutionChanged message.
--
Richard Gaskin
Fourth World Media Corporation
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
on mouseUp
global gSaveScreenRect
put the screenRect into gSaveScreenRect
put 1000 into n
put the millisecs into t
--
repeat n
send "checkResolution" to me
end repeat
--
put (the millisecs - t ) / n
end mouseUp
on checkResolution
global gSaveScreenRect
if the screenrect<> gSaveScreenRect then
answer "it changed"
end if
end checkResolution
More information about the use-livecode
mailing list