Re: NSProgressIndicator, Hiding and CPU Usage
Re: NSProgressIndicator, Hiding and CPU Usage
- Subject: Re: NSProgressIndicator, Hiding and CPU Usage
- From: email@hidden
- Date: Wed, 20 Mar 2002 15:06:13 -0800
I have a main window which includes an NSProgressIndicator - updated
every half hour to reflect the download usage from a local ISP. The
application works fine, but it has a behaviour that seems a little odd
and I'm hoping someone can help me.
The application also makes use of
[myMainWindow setHidesOnDeactivate:TRUE];
So that the application auto hides if another application is in the
foreground (it's an option).
Anyway, I've found that CPU usage for the application is at around 15%
if the window is hidden in this way, but if I hide the application from
the menu or COMMAND-H, or minimise the window, CPU usage is at 0%.
Can anyone give me some idea why this is the case, and how I can stop
it?
I do know that it is the NSProgressIndicator that causes the problem
(probably because even though it is determinate, it still animates
slightly with the blue slowly moving, so that is what is taking the
CPU). If I take out the progress indicator, the app sits at 0% when
hiding on deactivate.
Sounds like a bug; log it on Apple, and it will get fixed eventually
(one may hope).
As for how to make it stop: I think you've pretty much answered your
own question, above. Take the progress indicator out of your window
whenever your app is not the active app, if this preference is set. Put
it back in when your app activates. The user shouldn't notice anything,
since the window is hidden anyway. You can find out when your app
activates and deactivates using NSApplication's delegate methods or
notifications.
Good luck!
Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.