Re: NSProgressIndicator - hiding/visible
Re: NSProgressIndicator - hiding/visible
- Subject: Re: NSProgressIndicator - hiding/visible
- From: Peter Ammon <email@hidden>
- Date: Thu, 05 Jul 2001 13:52:33 -0700
on 7/5/01 9:49 AM, Kent Glenn at email@hidden wrote:
>
I am using a NSProgressIndicator, which is working, but I would like to
>
be able to hide it when I'm not using it. I expected to send it a
>
message of [ myProgress setVisible:false], or something like this, but I
>
don't see anything. I looked at it's super classes, but didn't see
>
anything that would help.
A view visibility toggle is something that lots of people have requested.
There's lots of ways to do it; here's mine.
- (void)setProgressBarVisible:(BOOL)isVisible {
NSSize newSize;
if (isVisible) newSize=NSMakeSize(293, 25);
else newSize=NSZeroSize;
[myProgressBar setBoundsSize:newSize];
[[myProgressBar superview] setNeedsDisplayInRect:[myProgressBar frame]];
}
Obviously, replace 293, 25 with the width and height of your progress bar.
-Peter