简体   繁体   English

删除 OS X 应用程序上的首选项菜单项

[英]Remove Preferences menu item on OS X apps

When using wxPython, is it possible to remove or disable the "Preferences" menu item that gets automatically created in the Python menu on OS X?使用 wxPython 时,是否可以删除或禁用在 OS X 上的 Python 菜单中自动创建的“首选项”菜单项?

For the benefit of others that may run into this, I figured out the solution: "wx.App_SetMacPreferencesMenuItemId(wx.ID_NONE)".为了其他可能遇到此问题的人的利益,我想出了解决方案:“wx.App_SetMacPreferencesMenuItemId(wx.ID_NONE)”。 The trick is to do this before you create the menu, not after.诀窍是在创建菜单之前执行此操作,而不是之后。 On wxPython 2.9.1.1 it will ghost out the Preferences menu item (which is good enough for me).在 wxPython 2.9.1.1 上,它会显示 Preferences 菜单项(这对我来说已经足够好了)。 On 2.9.2 it will remove the item completely.在 2.9.2 上,它将完全删除该项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM