NSProgressIndicator in NSButton

1.2k Views Asked by At

I have a refresh button in an NSToolbarItem and would like to replace the refresh icon with an NSProgressIndicator when there is data loading. Is this possible? Notably, it should still be a button (or at least look like one) but have the progress indicator instead of the button.

enter image description here

1

There are 1 best solutions below

0
On

I advice you to put progressIndicator in the same place with your button, but with Hidden flag. after you press the button, hide it and show the progress indicator.

for better effect you can use [[button animator] setHidden:YES] but don't forget to make your views layer backed, to make animator works.