Click a NSPushButton programmatically with “animation”

回眸只為那壹抹淺笑 提交于 2019-12-01 07:33:19

You can just send performClick: to the button. It will highlight itself, send its action to its target, and then unhighlight itself.

[self.someButton performClick:self];

If you really want to just highlight and unhighlight the button manually, you can use the highlight: method.

[self.someButton highlight:YES]; // button appears pressed
[self.someButton highlight:NO]; // button appears unpressed
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!