How do i make NSService contextual menu auto-enable without choose it in the system preference-keyboard-services then logout? [duplicate]
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?
精彩评论