开发者

How do i make NSService contextual menu auto-enable without choose it in the system preference-keyboard-services then logout? [duplicate]

This question already has an answer here: 开发者_JAVA技巧 Closed 11 years ago.

Possible Duplicate:

How do i enable the service menu programmatically with out the user log out then enable it in the keyboard preferences?

Now i register my app as the service provider,but user must turn it on in the preferences - keyboard -services,now what i want to be able to do is enable it automatically,without logout etc..


Pilfered from another thread:

" You need to include the NSRequiredContext key in each of your services' dictionaries.

The documentation doesn't mention this, but it is required since Mac OS X 10.6; as you've seen, your service will be disabled by default if you don't have it.

You should also call the NSUpdateDynamicServices function on launch, to refresh the user's Services menu without them having to log out and back in. "

How do i enable the service menu programmatically with out the user log out then enable it in the keyboard preferences?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜