【发布时间】:2017-10-16 12:54:19
【问题描述】:
我在创建窗口时设置了窗口的宽度和高度,现在我想在调用 ipc 主进程时更改同一窗口的宽度和高度。 这是我的代码
function createWindow() {
win = new BrowserWindow({
width: 448, // here I have set the width and height
height: 650,
frame: false,
transparent: true,
minimizable: true,
maximizable: true,
closable: true,
})
win.loadURL(url.format({
pathname: path.join(__dirname, './view/loginWindow.html'),
protocol: 'file:',
slashes: true
}))
.....
....
现在我调用ipc方法
ipcMain.on('userRegLinkClicked', (event, data) => {
win.setSize({
width: 448,
height: 850
})
}
但是没有任何效果,而是我收到错误TypeError: Error processing argument at index 0, conversion failure from #<Object>
【问题讨论】:
标签: electron