繁体   English   中英

在 Electron.js 中使用 `closeable: false` 关闭 windows

[英]Close windows with `closable: false` in Electron.js

I made an electron window that has an HTML menu in it, one of the buttons in the page is "New Game" that closes the window using windowObject.close() and launches a new window. 我想要的是仍然能够使用windowObject.close()关闭 window,同时使用窗口 Object 中的 closable closable:false属性禁用窗口的关闭按钮(因为closable属性阻止windowObject.close()工作)。 有没有办法在保持windowObject.close()工作的同时保持关闭按钮处于禁用状态(我需要框架的标题)?

在您尝试关闭它之前使其可关闭。

windowObject.closable = true;
windowObject.close();

暂无
暂无

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

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