[英]How to disable and re-enable menu bar
I would like to disable the menu bar (make it grey and unopenable).我想禁用菜单栏(将其设为灰色且无法打开)。 How to do that?怎么做?
I tried the following code but it removes the menu bar instead of disabling it.我尝试了以下代码,但它删除了菜单栏而不是禁用它。
Menu.setApplicationMenu(null);
Currently (being Electron v18.1.0), you can't disable top level menu items.目前(Electron v18.1.0),你不能禁用顶级菜单项。
See Github issue # 8703 Menu enabled/visible property doesn't affect top-level menu items for more information.有关详细信息,请参阅 Github 问题 # 8703 菜单启用/可见属性不影响顶级菜单项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.