Header menu logo fable-electron-docs-api

Options Type

Constructors

Constructor Description

Options(message, ?type, ?buttons, ?defaultId, ?title, ?detail, ?icon, ?textWidth, ?cancelId, ?noLink, ?normalizeAccessKeys)

Full Usage: Options(message, ?type, ?buttons, ?defaultId, ?title, ?detail, ?icon, ?textWidth, ?cancelId, ?noLink, ?normalizeAccessKeys)

Parameters:
    message : string - Content of the message box.
    ?type : Type - Can be none, info, error, question or warning. On Windows, question displays the same icon as info, unless you set an icon using the icon option. On macOS, both warning and error display the same warning icon.
    ?buttons : string[] - Array of texts for buttons. On Windows, an empty array will result in one button labeled "OK".
    ?defaultId : int - Index of the button in the buttons array which will be selected by default when the message box opens.
    ?title : string - Title of the message box, some platforms will not show it.
    ?detail : string - Extra information of the message.
    ?icon : U2<NativeImage, string> -
    ?textWidth : int - ⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ || Custom width of the text in the message box.
    ?cancelId : int - The index of the button to be used to cancel the dialog, via the Esc key. By default this is assigned to the first button with "cancel" or "no" as the label. If no such labeled buttons exist and this option is not set, 0 will be used as the return value.
    ?noLink : bool - On Windows Electron will try to figure out which one of the buttons are common buttons (like "Cancel" or "Yes"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set noLink to true.
    ?normalizeAccessKeys : bool - Normalize the keyboard access keys across platforms. Default is false. Enabling this assumes & is used in the button labels for the placement of the keyboard shortcut access key and labels will be converted so they work correctly on each platform, & characters are removed on macOS, converted to _ on Linux, and left untouched on Windows. For example, a button label of Vie&w will be converted to Vie_w on Linux and View on macOS and can be selected via Alt-W on Windows and Linux.

Returns: Options
message : string

Content of the message box.

?type : Type

Can be none, info, error, question or warning. On Windows, question displays the same icon as info, unless you set an icon using the icon option. On macOS, both warning and error display the same warning icon.

?buttons : string[]

Array of texts for buttons. On Windows, an empty array will result in one button labeled "OK".

?defaultId : int

Index of the button in the buttons array which will be selected by default when the message box opens.

?title : string

Title of the message box, some platforms will not show it.

?detail : string

Extra information of the message.

?icon : U2<NativeImage, string>

?textWidth : int

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ || Custom width of the text in the message box.

?cancelId : int

The index of the button to be used to cancel the dialog, via the Esc key. By default this is assigned to the first button with "cancel" or "no" as the label. If no such labeled buttons exist and this option is not set, 0 will be used as the return value.

?noLink : bool

On Windows Electron will try to figure out which one of the buttons are common buttons (like "Cancel" or "Yes"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set noLink to true.

?normalizeAccessKeys : bool

Normalize the keyboard access keys across platforms. Default is false. Enabling this assumes & is used in the button labels for the placement of the keyboard shortcut access key and labels will be converted so they work correctly on each platform, & characters are removed on macOS, converted to _ on Linux, and left untouched on Windows. For example, a button label of Vie&w will be converted to Vie_w on Linux and View on macOS and can be selected via Alt-W on Windows and Linux.

Returns: Options

Instance members

Instance member Description

this.buttons

Full Usage: this.buttons

Array of texts for buttons. On Windows, an empty array will result in one button labeled "OK".

this.cancelId

Full Usage: this.cancelId

The index of the button to be used to cancel the dialog, via the Esc key. By default this is assigned to the first button with "cancel" or "no" as the label. If no such labeled buttons exist and this option is not set, 0 will be used as the return value.

this.defaultId

Full Usage: this.defaultId

Index of the button in the buttons array which will be selected by default when the message box opens.

this.detail

Full Usage: this.detail

Extra information of the message.

this.icon

Full Usage: this.icon

this.message

Full Usage: this.message

Content of the message box.

this.noLink

Full Usage: this.noLink

On Windows Electron will try to figure out which one of the buttons are common buttons (like "Cancel" or "Yes"), and show the others as command links in the dialog. This can make the dialog appear in the style of modern Windows apps. If you don't like this behavior, you can set noLink to true.

this.normalizeAccessKeys

Full Usage: this.normalizeAccessKeys

Normalize the keyboard access keys across platforms. Default is false. Enabling this assumes & is used in the button labels for the placement of the keyboard shortcut access key and labels will be converted so they work correctly on each platform, & characters are removed on macOS, converted to _ on Linux, and left untouched on Windows. For example, a button label of Vie&w will be converted to Vie_w on Linux and View on macOS and can be selected via Alt-W on Windows and Linux.

this.textWidth

Full Usage: this.textWidth

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ Custom width of the text in the message box.

this.title

Full Usage: this.title

Title of the message box, some platforms will not show it.

this.type

Full Usage: this.type

Can be none, info, error, question or warning. On Windows, question displays the same icon as info, unless you set an icon using the icon option. On macOS, both warning and error display the same warning icon.

Type something to start searching.