Header menu logo fable-electron-docs-api

Options Type

Constructors

Constructor Description

Options(?window, ?frame, ?x, ?y, ?positioningItem, ?sourceType, ?callback)

Full Usage: Options(?window, ?frame, ?x, ?y, ?positioningItem, ?sourceType, ?callback)

Parameters:
    ?window : BaseWindow - Default is the focused window.
    ?frame : WebFrameMain - Provide the relevant frame if you want certain OS-level features such as Writing Tools on macOS to function correctly. Typically, this should be params.frame from the context-menu event on a WebContents, or the focusedFrame property of a WebContents.
    ?x : float - Default is the current mouse cursor position. Must be declared if y is declared.
    ?y : float - Default is the current mouse cursor position. Must be declared if x is declared.
    ?positioningItem : float - ⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ || The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.
    ?sourceType : SourceType - ⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ✔ | MAS ❌ || This should map to the menuSourceType provided by the context-menu event. It is not recommended to set this value manually, only provide values you receive from other APIs or leave it undefined. Can be none, mouse, keyboard, touch, touchMenu, longPress, longTap, touchHandle, stylus, adjustSelection, or adjustSelectionReset.
    ?callback : unit -> unit - Called when menu is closed.

Returns: Options
?window : BaseWindow

Default is the focused window.

?frame : WebFrameMain

Provide the relevant frame if you want certain OS-level features such as Writing Tools on macOS to function correctly. Typically, this should be params.frame from the context-menu event on a WebContents, or the focusedFrame property of a WebContents.

?x : float

Default is the current mouse cursor position. Must be declared if y is declared.

?y : float

Default is the current mouse cursor position. Must be declared if x is declared.

?positioningItem : float

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ || The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.

?sourceType : SourceType

⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ✔ | MAS ❌ || This should map to the menuSourceType provided by the context-menu event. It is not recommended to set this value manually, only provide values you receive from other APIs or leave it undefined. Can be none, mouse, keyboard, touch, touchMenu, longPress, longTap, touchHandle, stylus, adjustSelection, or adjustSelectionReset.

?callback : unit -> unit

Called when menu is closed.

Returns: Options

Instance members

Instance member Description

this.callback

Full Usage: this.callback

Called when menu is closed.

this.frame

Full Usage: this.frame

Provide the relevant frame if you want certain OS-level features such as Writing Tools on macOS to function correctly. Typically, this should be params.frame from the context-menu event on a WebContents, or the focusedFrame property of a WebContents.

this.positioningItem

Full Usage: this.positioningItem

⚠ OS Compatibility: WIN ❌ | MAC ✔ | LIN ❌ | MAS ❌ The index of the menu item to be positioned under the mouse cursor at the specified coordinates. Default is -1.

this.sourceType

Full Usage: this.sourceType

⚠ OS Compatibility: WIN ✔ | MAC ❌ | LIN ✔ | MAS ❌ This should map to the menuSourceType provided by the context-menu event. It is not recommended to set this value manually, only provide values you receive from other APIs or leave it undefined. Can be none, mouse, keyboard, touch, touchMenu, longPress, longTap, touchHandle, stylus, adjustSelection, or adjustSelectionReset.

this.window

Full Usage: this.window

Default is the focused window.

this.x

Full Usage: this.x

Default is the current mouse cursor position. Must be declared if y is declared.

this.y

Full Usage: this.y

Default is the current mouse cursor position. Must be declared if x is declared.

Type something to start searching.