| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSProgressIndicator.h |
| Related sample code |
The NSProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way. Some progress indicators are indeterminate and do nothing more than spin to show that the application is busy. Others are determinate and show the percentage of the task that has been completed.
– setUsesThreadedAnimation:
– startAnimation:
– stopAnimation:
– usesThreadedAnimation
– animate: Deprecated in Mac OS X v10.5 and later
– animationDelay Deprecated in Mac OS X v10.5 and later
– setAnimationDelay: Deprecated in Mac OS X v10.5 and later
– setControlSize:
– controlSize
– setControlTint:
– controlTint
– setBezeled:
– isBezeled
– setIndeterminate:
– isIndeterminate
– setStyle:
– style
– sizeToFit
– setDisplayedWhenStopped:
– isDisplayedWhenStopped
Returns the size of the receiver.
- (NSControlSize)controlSize
A constant indicating the size of the control. Valid return values are described in NSCell.
NSProgressIndicator.hReturns the receiver’s control tint.
- (NSControlTint)controlTint
A constant indicating the current control tint. Valid return values are described in NSCell.
NSProgressIndicator.hReturns a value that indicates the current extent of the progress bar of a determinate progress indicator.
- (double)doubleValue
The value representing the current extent of a determinate progress bar. For example, a determinate progress indicator goes from 0.0 to 100.0 by default. If the progress bar has advanced halfway across the view, the value returned by doubleValue would be 50.0. An indeterminate progress indicator does not use this value.
NSProgressIndicator.hAdvances the progress bar of a determinate progress indicator by the specified amount.
- (void)incrementBy:(double)delta
The amount by which to increment the progress bar. For example, if you want to advance a progress bar from 0.0 to 100.0 in 20 steps, you would invoke incrementBy: 20 times with a delta value of 5.0.
NSProgressIndicator.hReturns a Boolean value indicating whether the receiver's frame has a bezel.
- (BOOL)isBezeled
YES if the receiver’s frame has a three-dimensional bezel; otherwise, NO.
NSProgressIndicator.hReturns a Boolean value indicating whether the receiver shows itself even when it’s not animating.
- (BOOL)isDisplayedWhenStopped
YES if the progress indicator shows itself even when it’s not animating. By default, this returns returns YES if style is NSProgressIndicatorBarStyle and NO if style isNSProgressIndicatorSpinningStyle.
NSProgressIndicator.h
Returns a Boolean value indicating whether the receiver is indeterminate.
- (BOOL)isIndeterminate
YES if the progress bar is indeterminate; otherwise NO. This applies only if style returns NSProgressIndicatorBarStyle.
If style returns NSProgressIndicatorSpinningStyle, the indicator is always indeterminate, regardless of what this method returns.
A determinate indicator displays how much of the task has been completed. An indeterminate indicator shows simply that the application is busy.
NSProgressIndicator.hReturns the maximum value for the progress bar of a determinate progress indicator.
- (double)maxValue
The maximum value of the progress indicator. By default, a determinate progress indicator goes from 0.0 to 100.0, so the value returned would be 100.0. An indeterminate progress indicator does not use this value.
NSProgressIndicator.hReturns the minimum value for the progress bar of a determinate progress indicator.
- (double)minValue
The minimum value of the progress indicator. By default, a determinate progress indicator goes from 0.0 to 100.0, so the value returned would be 0.0. An indeterminate progress indicator does not use this value.
NSProgressIndicator.hSets whether the receiver’s frame has a three-dimensional bezel.
- (void)setBezeled:(BOOL)flag
YES if the progress indicator is bezeled; otherwise, NO.
NSProgressIndicator.hSets the size of the receiver.
- (void)setControlSize:(NSControlSize)size
A constant indicating the size of the control. Valid values for size are described in NSCell.
NSProgressIndicator.hSets the receiver’s control tint.
- (void)setControlTint:(NSControlTint)controlTint
A constant indicating the desired control tint. Valid values for controlTint are described in NSCell.
NSProgressIndicator.hSets whether the receiver hides itself when it isn’t animating.
- (void)setDisplayedWhenStopped:(BOOL)isDisplayed
YES to hide the progress indicator when it isn't animating; otherwise NO. By default, this is YES if style is NSProgressIndicatorBarStyle, and NO if style is NSProgressIndicatorSpinningStyle.
NSProgressIndicator.h
Sets the value that indicates the current extent of the receiver.
- (void)setDoubleValue:(double)doubleValue
The current extent of a determinate progress indicator.
An indeterminate progress indicator does not use this value.
NSProgressIndicator.h
Sets whether the receiver is indeterminate.
- (void)setIndeterminate:(BOOL)flag
YES if the progress indicator should be indeterminate; otherwise NO.
This method only has an effect if style returns NSProgressIndicatorBarStyle. If style returns NSProgressIndicatorSpinningStyle, the indicator is always indeterminate, regardless of what you pass to this method.
NSProgressIndicator.hSets the maximum value for the receiver.
- (void)setMaxValue:(double)newMaximum
The maximum value of the progress indicator. An indeterminate progress indicator does not use this value.
NSProgressIndicator.hSets the minimum value for the receiver.
- (void)setMinValue:(double)newMinimum
The minimum value of the progress indicator. An indeterminate progress indicator does not use this value.
NSProgressIndicator.hSets the style of the progress indicator (bar or spinning).
- (void)setStyle:(NSProgressIndicatorStyle)style
A constant indicating the style of the progress indicator. Possible values for style are described in NSProgressIndicatorStyle.
NSProgressIndicator.hSets a hint as to whether the receiver should implement animation of the progress indicator in a separate thread.
- (void)setUsesThreadedAnimation:(BOOL)flag
YES to indicate that animation of the progress indicator should occur in a separate thread; otherwise, NO. This value is only a hint and may be ignored.
If the application becomes multithreaded as a result of an invocation of this method, the application’s performance could become noticeably slower.
NSProgressIndicator.hThis action method resizes the receiver to an appropriate size depending on what style returns.
- (void)sizeToFit
Use this after you use setStyle: to re-size the receiver.
NSProgressIndicator.hStarts the animation of an indeterminate progress indicator.
- (void)startAnimation:(id)sender
The object sending the message.
Does nothing for a determinate progress indicator.
NSProgressIndicator.hStops the animation of an indeterminate progress indicator.
- (void)stopAnimation:(id)sender
The object sending the message.
Does nothing for a determinate progress indicator.
NSProgressIndicator.hReturns the style of the progress indicator (bar or spinning).
- (NSProgressIndicatorStyle)style
A constant indicating the style of the progress indicator. Possible return values are described in NSProgressIndicatorStyle.
NSProgressIndicator.h
Returns whether the receiver implements the animation of the progress indicator in a separate thread.
- (BOOL)usesThreadedAnimation
YES if animation of the progress indicator occurs in a separate thread; otherwise, NO.
NSProgressIndicator.hSpecify the height of a progress indicator.
typedef enum _NSProgressIndicatorThickness { NSProgressIndicatorPreferredThickness = 14, NSProgressIndicatorPreferredSmallThickness = 10, NSProgressIndicatorPreferredLargeThickness = 18, NSProgressIndicatorPreferredAquaThickness = 12 } NSProgressIndicatorThickness;
NSProgressIndicatorPreferredThickness14
Available in Mac OS X v10.0 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicatorPreferredSmallThickness10
Available in Mac OS X v10.0 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicatorPreferredLargeThickness18
Available in Mac OS X v10.0 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicatorPreferredAquaThickness12
Available in Mac OS X v10.0 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicator.hSpecify the progress indicator’s style and are used by style and setStyle:.
typedef enum _NSProgressIndicatorStyle { NSProgressIndicatorBarStyle = 0, NSProgressIndicatorSpinningStyle = 1 } NSProgressIndicatorStyle;
NSProgressIndicatorBarStyleA rectangular indicator that can be determinate or indeterminate.
Available in Mac OS X v10.2 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicatorSpinningStyleA small square indicator that can be indeterminate only .
Available in Mac OS X v10.2 and later.
Declared in NSProgressIndicator.h.
NSProgressIndicator.h
© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-03-11)