ContextMenuBuilder Module
Building and popping up the right-click menus, for the main process only. The menu DATA - which menus exist and what is on them - stays in ContextMenus.fs, which both processes compile: the renderer needs it to ask for a menu by name and to recognise the item that comes back. Only the part that builds an Electron menu is here, because it needs the electron module, and requiring that is what a renderer without node integration cannot do.
Functions and values
| Function or value | Description |
Full Usage:
makeClickableReturner dispatchToRenderer ev (arg3, arg4)
Parameters:
string * string -> unit
ev : IpcMainEvent
arg2 : string
arg3 : string
Returns: MenuItemConstructorOptions
|
function used to implement main process context menu items. It should not be changed. An item that has a keyboard shortcut carries it as an accelerator, so the platform draws it where it draws every other one - on the right of the menu, in that platform's own words. It is registered with nothing: registerAccelerator false. Issie dispatches every key itself, from one listener, and an accelerator registered here would be a second claim on the same chord - which is the arrangement the key dispatcher was written to replace.
|
Full Usage:
makeMenu window dispatchToRenderer args
Parameters:
BrowserWindow
dispatchToRenderer : string * string -> unit
args : ResizeArray<obj option>
Returns: IpcMainEvent -> unit
|
|