1.1.1 • Published 6 years ago

@rubix-code/electron-update-window-options v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

electron-update-window-options

This library allows you to update an electron window after it's already been created using the constructor options schema.

updateWindowOptions(browserWindow, { movable: false });

is the same as

new BrowserWindow({ movable: false });

But you can use this function after it's created

Examples/Usage

const { BrowserWindow, app } = require("electron");
const updateWindowOptions = require("electron-update-window-options");

app.on("ready", () => {
  const browserWindow = new BrowserWindow({ movable: true });

  browserWindow.setMovable(false);
  // Is the same as
  updateWindowOptions(browserWindow, { movable: false });
  // But this is the same format as
  // new BrowserWindow(/* this */);
});