NSProgressIndicator Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSProgressIndicator.h |
Overview
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.
Tasks
Animating the Progress Indicator
-
– setUsesThreadedAnimation: -
– startAnimation: -
– stopAnimation: -
– usesThreadedAnimation -
– animate:Deprecated in OS X v10.5 and later -
– animationDelayDeprecated in OS X v10.5 and later -
– setAnimationDelay:Deprecated in OS X v10.5 and later
Advancing the Progress Bar
Setting the Appearance
Instance Methods
controlSize
Returns the size of the receiver.
Return Value
A constant indicating the size of the control. Valid return values are described in NSCell.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hcontrolTint
Returns the receiver’s control tint.
Return Value
A constant indicating the current control tint. Valid return values are described in NSCell.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hdoubleValue
Returns a value that indicates the current extent of the progress bar of a determinate progress indicator.
Return Value
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hincrementBy:
Advances the progress bar of a determinate progress indicator by the specified amount.
Parameters
- 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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hisBezeled
Returns a Boolean value indicating whether the receiver's frame has a bezel.
Return Value
YES if the receiver’s frame has a three-dimensional bezel; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hisDisplayedWhenStopped
Returns a Boolean value indicating whether the receiver shows itself even when it’s not animating.
Return Value
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.
Availability
- Available in OS X v10.2 and later.
See Also
Declared In
NSProgressIndicator.hisIndeterminate
Returns a Boolean value indicating whether the receiver is indeterminate.
Return Value
YES if the progress bar is indeterminate; otherwise NO. This applies only if style returns NSProgressIndicatorBarStyle.
Discussion
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hmaxValue
Returns the maximum value for the progress bar of a determinate progress indicator.
Return Value
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hminValue
Returns the minimum value for the progress bar of a determinate progress indicator.
Return Value
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetBezeled:
Sets whether the receiver’s frame has a three-dimensional bezel.
Parameters
- flag
YESif the progress indicator is bezeled; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetControlSize:
Sets the size of the receiver.
Parameters
- size
A constant indicating the size of the control. Valid values for size are described in NSCell.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetControlTint:
Sets the receiver’s control tint.
Parameters
- controlTint
A constant indicating the desired control tint. Valid values for controlTint are described in NSCell.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetDisplayedWhenStopped:
Sets whether the receiver hides itself when it isn’t animating.
Parameters
- isDisplayed
YESto hide the progress indicator when it isn't animating; otherwiseNO. By default, this isYESifstyleisNSProgressIndicatorBarStyle, andNOifstyleisNSProgressIndicatorSpinningStyle.
Availability
- Available in OS X v10.2 and later.
See Also
Declared In
NSProgressIndicator.hsetDoubleValue:
Sets the value that indicates the current extent of the receiver.
Parameters
- doubleValue
The current extent of a determinate progress indicator.
Discussion
An indeterminate progress indicator does not use this value.
Availability
- Available in OS X v10.0 and later.
Declared In
NSProgressIndicator.hsetIndeterminate:
Sets whether the receiver is indeterminate.
Parameters
- flag
YESif the progress indicator should be indeterminate; otherwiseNO.
Discussion
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetMaxValue:
Sets the maximum value for the receiver.
Parameters
- newMaximum
The maximum value of the progress indicator. An indeterminate progress indicator does not use this value.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetMinValue:
Sets the minimum value for the receiver.
Parameters
- newMinimum
The minimum value of the progress indicator. An indeterminate progress indicator does not use this value.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsetStyle:
Sets the style of the progress indicator (bar or spinning).
Parameters
- style
A constant indicating the style of the progress indicator. Possible values for style are described in
NSProgressIndicatorStyle.
Availability
- Available in OS X v10.2 and later.
See Also
Declared In
NSProgressIndicator.hsetUsesThreadedAnimation:
Sets a hint as to whether the receiver should implement animation of the progress indicator in a separate thread.
Parameters
- flag
YESto 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.
Discussion
If the application becomes multithreaded as a result of an invocation of this method, the application’s performance could become noticeably slower.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hsizeToFit
This action method resizes the receiver to an appropriate size depending on what style returns.
Discussion
Use this after you use setStyle: to re-size the receiver.
Availability
- Available in OS X v10.2 and later.
Declared In
NSProgressIndicator.hstartAnimation:
Starts the animation of an indeterminate progress indicator.
Parameters
- sender
The object sending the message.
Discussion
Does nothing for a determinate progress indicator.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hstopAnimation:
Stops the animation of an indeterminate progress indicator.
Parameters
- sender
The object sending the message.
Discussion
Does nothing for a determinate progress indicator.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hstyle
Returns the style of the progress indicator (bar or spinning).
Return Value
A constant indicating the style of the progress indicator. Possible return values are described in NSProgressIndicatorStyle.
Availability
- Available in OS X v10.2 and later.
See Also
Declared In
NSProgressIndicator.husesThreadedAnimation
Returns whether the receiver implements the animation of the progress indicator in a separate thread.
Return Value
YES if animation of the progress indicator occurs in a separate thread; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSProgressIndicator.hConstants
NSProgressIndicatorThickness
Specify the height of a progress indicator.
typedef enum _NSProgressIndicatorThickness {
NSProgressIndicatorPreferredThickness = 14,
NSProgressIndicatorPreferredSmallThickness = 10,
NSProgressIndicatorPreferredLargeThickness = 18,
NSProgressIndicatorPreferredAquaThickness = 12
} NSProgressIndicatorThickness;
Constants
NSProgressIndicatorPreferredThickness14
Available in OS X v10.0 and later.
Declared in
NSProgressIndicator.h.NSProgressIndicatorPreferredSmallThickness10
Available in OS X v10.0 and later.
Declared in
NSProgressIndicator.h.NSProgressIndicatorPreferredLargeThickness18
Available in OS X v10.0 and later.
Declared in
NSProgressIndicator.h.NSProgressIndicatorPreferredAquaThickness12
Available in OS X v10.0 and later.
Declared in
NSProgressIndicator.h.
Availability
- Available in OS X v10.0 and later.
Declared In
NSProgressIndicator.hNSProgressIndicatorStyle
Specify the progress indicator’s style and are used by style and setStyle:.
typedef enum _NSProgressIndicatorStyle {
NSProgressIndicatorBarStyle = 0,
NSProgressIndicatorSpinningStyle = 1
} NSProgressIndicatorStyle;
Constants
NSProgressIndicatorBarStyleA rectangular indicator that can be determinate or indeterminate.
Available in OS X v10.2 and later.
Declared in
NSProgressIndicator.h.NSProgressIndicatorSpinningStyleA small square indicator that can be indeterminate only .
Available in OS X v10.2 and later.
Declared in
NSProgressIndicator.h.
Availability
- Available in OS X v10.2 and later.
Declared In
NSProgressIndicator.h© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-03-11)