“Expose” effect in a Mac application

淺唱寂寞╮ 提交于 2019-12-12 03:05:01

问题


Is there any way or function that can be used to obtain the expose effect in Mac, when a button is clicked?

I tried searching, but I had no luck, so far.


回答1:


There is no API for this. AFAIK the only way to do it is to use NSWorkspace to launch either the Exposé app (Mac OS X versions < 10.7) or the Mission Control app (Mac OS X versions >= 10.7).

This code uses the com.apple.exposelauncher bundle ID which is the same for all versions of Mac OS X that ship with Exposé:

[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"com.apple.exposelauncher" 
                                                     options:NSWorkspaceLaunchDefault 
                              additionalEventParamDescriptor:NULL 
                                            launchIdentifier:NULL];


来源:https://stackoverflow.com/questions/8227155/expose-effect-in-a-mac-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!