How to remove NSMenuItem gap above custom view

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:14:23

问题


I was looking for something discussed in following posts.

Gap above NSMenuItem custom view.

Reverse engineering an NSMenu for a Status Bar Item

I tried the carbon code provided by Pierre Bernard

initially, i was getting same error "EXC_BAD_ACCESS on the line InstallControlEventHandler" like other had. I play with the code lots and accidently found the solution.

I have just replaced the InstallControlEventHandler function call to HIViewInstallEventHandler and everything is working fine.

Hope this will help others. Let me know if anyone need further clarification.

Special thanks to Pierre Bernard to provide great code.

Thanks


回答1:


Just replace the InstallControlEventHandler function call to HIViewInstallEventHandler and code will work fine.

Thanks



来源:https://stackoverflow.com/questions/6633843/how-to-remove-nsmenuitem-gap-above-custom-view

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