admin管理员组文章数量:1332319
I stated using Electron and trying to make minimize and close button.
index.html
<button id="minus" onclick="minimize()">minimize</span></button>
<button id="close" onclick="close()">close</span></button>
index.js
const remote = require('electron').remote;
function minimize(){
var window = remote.getCurrentWindow();
window.minimize();
}
function close(){
var window = remote.getCurrentWindow();
window.close();
}
I must be doing some silly mistake or what but minimize button works perfectly while close button not working.
I also tried EventListener method as mentioned here Atom Electron - Close the window with javascript And it works perfectly, but why my function approach isn't working??
I stated using Electron and trying to make minimize and close button.
index.html
<button id="minus" onclick="minimize()">minimize</span></button>
<button id="close" onclick="close()">close</span></button>
index.js
const remote = require('electron').remote;
function minimize(){
var window = remote.getCurrentWindow();
window.minimize();
}
function close(){
var window = remote.getCurrentWindow();
window.close();
}
I must be doing some silly mistake or what but minimize button works perfectly while close button not working.
I also tried EventListener method as mentioned here Atom Electron - Close the window with javascript And it works perfectly, but why my function approach isn't working??
Share Improve this question edited May 23, 2017 at 11:45 CommunityBot 11 silver badge asked Aug 13, 2016 at 11:14 shubh jaiswalshubh jaiswal 4381 gold badge6 silver badges18 bronze badges1 Answer
Reset to default 6Oh, I Solved this problem just by changing function name of close() function to something else, it seems like close is conflicting with some other function or something like that.
本文标签: Atom Electron Close and Minimize window using the html button and javascriptStack Overflow
版权声明:本文标题:Atom Electron Close and Minimize window using the html button and javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742339596a2456327.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论