@rubix-code/electron-update-window-options
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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 */);
});

Package Sidebar

Install

npm i @rubix-code/electron-update-window-options

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

12.5 kB

Total Files

9

Last publish

Collaborators

  • rubix-code