EDIT 2: I found out in web2exe application: Include NODEjs needs to be checked. That solved my problem.
编辑2:我在web2exe应用程序中发现:需要检查包含NODEjs。这解决了我的问题。
I am using web2exe application for automated exe packaging, so I need only two functions from NWJS:
我正在使用web2exe应用程序进行自动exe包装,所以我只需要NWJS的两个函数:
Exit an application (close window) and toggle between window and fullscreen.
退出应用程序(关闭窗口)并在窗口和全屏之间切换。
I found some code for this, but when I placed it in my main JS file, nothing happens. What I am doing wrong? Edit: I found a following code:
我找到了一些代码,但当我把它放在我的主JS文件中时,没有任何反应。我做错了什么?编辑:我发现了以下代码:
function winclose() {
var gui = require('nw.gui');
var win = gui.Window.get();
win.close();
}
When I call this function, nothing happens. I do not have Inspect Element, so I cant see any errors. And I can assure you, my code is perfectly clear, without any bugs, and this function and call to it is placed correctly.
当我调用此函数时,没有任何反应。我没有Inspect Element,所以我看不到任何错误。我可以向你保证,我的代码非常清晰,没有任何错误,而且这个函数和对它的调用都是正确放置的。
So, could it be, that I need to write this code in to another source file and not in my own? Or maybe this application (web2exe), is interfering somehow?
那么,是不是我需要将这段代码写入另一个源文件而不是我自己的?或许这个应用程序(web2exe),以某种方式干扰?
1 个解决方案
#1
0
Have you tried using win.close(true)
? To clarify it you really need to enable devtools.
你尝试过使用win.close(true)吗?为了澄清它,你真的需要启用devtools。
#1
0
Have you tried using win.close(true)
? To clarify it you really need to enable devtools.
你尝试过使用win.close(true)吗?为了澄清它,你真的需要启用devtools。