Questions tagged [nsprogressindicator]

The NSProgress​Indicator class lets a macOS app display a progress indicator to show that a lengthy task is under way.

The NSProgress​Indicator class lets a macOS app display a progress indicator to show that a lengthy task is under way. Some progress indicators are indeterminate and do nothing more than show that the app is busy. Others are determinate and show the percentage of the task that has been completed.

Note: This is an macOS class. In iOS one might use UIProgressView for determinate progress or a UIActivityIndicatorView for indeterminate progress.

References

121 questions
10
votes
1 answer

Indeterminate NSProgressIndicator will not animate

So I've got a simple UI, A Start button, some text/labels, and a progress bar. When the Start button is click, the NSProgressIndicator should animate. Here's my code: @synthesize progressBar = progressBar; /* Some code and setup stuffs... */ -…
Ech0riginal
  • 329
  • 1
  • 3
  • 7
9
votes
2 answers

Adding an NSProgressIndicator to the dock icon

I'm creating an application which should show a progress bar in the dock icon. Currently I have this, but it's not working: NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 10.0f, 20.0f)]; …
user142019
9
votes
2 answers

Swift: How to use NSProgressIndicator?

I want to use an NSProgressIndicator to show some progress. But I couldn't find a method which increases the bar of that control. I did also not find an example on the web. let progressbar = NSProgressIndicator() progressbar.frame = NSRect(x: 100,…
PjotrC
  • 311
  • 1
  • 6
  • 16
9
votes
8 answers

Changing the color of NSProgressIndicator?

What is the best way to change the color of NSProgressIndicator, is there an easier way than just to subclass it and then draw the whole component by myself? Basically what I want to do is to have a similar component but with the ability to change…
Samuli Lehtonen
  • 3,840
  • 5
  • 39
  • 49
8
votes
1 answer

Displaying file copy progress using FSCopyObjectAsync

It appears after much searching that there seems to be a common problem when trying to do a file copy and show a progress indicator relative to the amount of the file that has been copied. After spending some considerable time trying to resolve this…
8
votes
4 answers

NSProgressIndicator can't set background color to white

When I set my progress indicator's background to green, it works as expected. Code: loadingIndicator.wantsLayer = true loadingIndicator.layer?.backgroundColor = NSColor.greenColor().CGColor Result: But when I set the background color to white,…
Adam Johns
  • 35,397
  • 25
  • 123
  • 176
7
votes
3 answers

Using NSProgressIndicator inside an NSMenuItem

I'm trying to use a NSProgressIndicator (indeterminate) inside of a statusbar-menu. I'm using an NSView-object as view for the menuitem, and then subviews the progress indicator to display it. But whenever i try to call the startAnimation: for the…
Henrik
  • 582
  • 1
  • 3
  • 15
6
votes
4 answers

How to use a determinate NSProgressIndicator to check on the progress of NSTask? - Cocoa

What I have is NSTask running a long premade shell script and I want the NSProgressIndicator to check on how much is done. I've tried many things but just can't seem to get it to work. I know how to use it if the progress bar is indeterminate but i…
doctor_ew
  • 123
  • 2
  • 11
6
votes
2 answers

How to check if a NSProgressIndicator is currently animated?

NSProgressIndicator has methods called startAnimation: and stopAnimation:, but no method that I can find to check the state (whether it is currently animating or not). How would you do it?
F'x
  • 12,105
  • 7
  • 71
  • 123
5
votes
2 answers

What causes a white border to be applied to an NSProgressIndicator displayed in the system menu?

This is what happens when I create an NSProgressIndicator and use NSStatusItem's -setView: method to display it in the menubar area while I'm performing an action: Example of messed up NSProgressIndicator http://cl.ly/l9R/content What causes this…
Abraham Vegh
  • 1,490
  • 1
  • 12
  • 32
5
votes
2 answers

Subclass NSProgressIndicator

i like to subclass a NSProgressIndicator. I've used this code and i set the Subclass in the Interface Builder: - (void)drawRect:(NSRect)dirtyRect { NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); CGFloat radius = rect.size.height /…
Konobi
  • 401
  • 1
  • 6
  • 14
4
votes
1 answer

How to rotate NSProgressIndicator by 90 deg

I need to rotate NSProgressIndicator by 90 deg. When I use the following code: [self.progressIndicator1 setWantsLayer:NO]; [self.progressIndicator1 setFrameCenterRotation:90]; [self.progressIndicator1 setMinValue:0]; [self.progressIndicator1…
abg
  • 2,002
  • 7
  • 39
  • 63
4
votes
1 answer

How to create the NSMenuItem view for a menu item with an embedded NSProgressIndicator?

I would like to create a menu item with an embedded NSProgressIndicator, similar to the "Wi-Fi: Looking for Networks…" menu item of the Wi-Fi status menu: I think that I will need to use the setView: method as discussed at: Views in Menu Items. …
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
4
votes
2 answers

How can I remove the white square around my NSProgressIndicator?

I'm adding an NSProgressIndicator to my NSMenuItem (with a custom view). It works fine, but it has a weird square around it: Here is my code: // In my @interface declaration: NSProgressIndicator *_spinner; ... // In initWithFrame: _spinner =…
David Murray
  • 541
  • 5
  • 19
4
votes
0 answers

How do I use an NSProgressIndicator as the view of an NSToolbarItem and have it show in the customisation sheet?

I have an NSToolbar set up in my app. It was created in IB. One of the toolbar items uses a spinner-style NSProgressIndicator as its view, the rest are images. When the toolbar's customization sheet is showing, the spinner does not show in the…
Fraser Speirs
  • 4,642
  • 3
  • 21
  • 15
1
2 3
8 9