usermenu

Far Manager Macro System

usermenu


mf.usermenu (mode, filename)

Parameters:
  mode:     number (0 by default)
  filename: string or nil

Returns:
  nothing

Description:
  Opens or creates a user menu.

  Function behavior depends on the least significant byte of mode:

    0: equivalent to pressing F2 in panels; filename is ignored.
    1: displays the dialog for user menu selection; filename is ignored.
    2: opens user menu from the file "as is", i.e. by specified filename.
    3: opens user menu from the file filename in %farprofile%\Menus
       (the directory is created automatically).

  If the bit 0x100 of mode is set the function will return only upon closing
  the menu (synchronous call). If that bit is cleared the function will return
  immediately when the menu is opened (asynchronous call).

See also:
Restrictions in the use of some functions