NSPopup or something similar to indicate progress
I am not sure which class I need. I am looking to implement the following:
- User clicks on NSButton ( Have this working)
- Have a background task run once he does this. (have this working)
- While the task is in progress, I want to display a small popup which indicates the task is in progress a开发者_开发百科nd asks the user to wait/give him some more informtion. ( This is where I need help)
I am not really sure what class would help me get this popup..NSPopup /NsAlert ? Appreciate any pointers. Thanks.
In addition to Peter's answer: Spend some time perusing Interface Builder's Library palette so you know what standard controls are available and what they're called. Spend more time reading the AppKit API reference to get a feel for how they work in general.
The specific control to display progress is an NSProgressIndicator. As Peter said, you can put this in a view or a sheet but the best approach really depends on the factors Peter mentioned.
It should simply be a view in your window.
If the user cannot do anything in the window until the operation finishes (and you should do everything you can to prevent such obstruction), then it should be a sheet over the window.
If the user can do more than one of these operations at the same time and they don't prevent the user from doing other things with the window, then a view in the window will become unwieldy, and you should move the progress display to a dedicated progress window, as done by Transmit, Mail, Adium, Finder, Amadeus Pro, and many other applications.
精彩评论