Skip to main content Link Search Menu Expand Document (external link)

The Dialog Factory Interface

The dialog factory interface creates BrowserWindow instances meant to be used as dialogs in Jancy.

There is only one dialog factory and it can always be found at jancy.dialogFactory.

Methods

dialogFactory.create(parent, browserWindowOptions, options)

  • parent (BrowserWindow) the BrowserWindow that will be the parent of this dialog
  • browserWindowOptions (object) options to override the defaults used by the factory
  • options (object) dialog factory specific options
    • centerRelativeToParent (boolean) optional if true the resulting dialog will be centerered relative to parent

Returns a BrowserWindow instance.

let dialog = jancy.dialogFactory.create(
  browserWindow,
  {
    width: 400,
    height: 175,
    title: 'My Dialog'
  },
  {
    centerRelativeToParent: true
  }
)

This method just creates the instance and it won’t be visible on the screen. There’s generally more work that goes into actually making a useful dialog.