Re: ScreenSaverView gets instantiated several times
Re: ScreenSaverView gets instantiated several times
- Subject: Re: ScreenSaverView gets instantiated several times
- From: Roland King <email@hidden>
- Date: Mon, 05 Oct 2009 18:06:52 +0800
Yes, I do.
In particular, because it has a major impact on the way one has to
design the code.
For instance, if changing the configuration causes some longish
computations.
I tried pretty hard to hide this from the user, so that after applying
the changes of the configuration of my screen saver, the user does not
have to wait for tens of seconds until the screen saver resumes operation.
Now, the design I chose to achieve this is useless, because when the
user clicks 'Test', System Preferences just goes ahead and creates a
new instance!
Now, it seems that I have no other choice than keep up the modal panel
until the computations ensuing the config chance are finished ;-(
Well it's not necessarily useless, you just need to put it elsewhere.
What were you doing (or trying to do) before when the user changed
configuration? Were you displaying the 'last version' whilst calculating
things in the background and then switching to the new version .. which
would be a bit confusing. Or are you saying the first time the screen
saver is used you do a bunch of complicated calculations which are slow
but the results of which you cache in the instance of your screen saver
class and when you change the config a bit you can recalculate the new
values quite rapidly? If it's the latter, you could store the 'basic'
calculations in static variables in your class, calculate them once and
then have every instance of the screen saver use them.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden