Skip to content

Latest commit

 

History

History
74 lines (62 loc) · 7.82 KB

File metadata and controls

74 lines (62 loc) · 7.82 KB

docs » plugins.core.menu.manager.section


Controls sections for the CommandPost menu.

API Overview

API Documentation

Methods

Signature plugins.core.menu.manager.section:_addGenerator() -> section
Type Method
Description A private method for registering a generator. This should not be called directly.
Parameters
  • generator - The generator being added.
Returns
  • section - The section.
Signature plugins.core.menu.manager.section:addItem(priority, itemFn) -> section
Type Method
Description Registers a function which will generate a single table item.
Parameters
  • priority - The priority of the item within the section. Lower numbers appear first.
  • itemFn - A function which will return a table representing a single menu item. See hs.menubar for details.
Returns
  • section - The section the item was added to.
Signature plugins.core.menu.manager.section:addItems(priority, itemsFn) -> section
Type Method
Description Registers a function which will generate multiple table items.
Parameters
  • priority - The priority of the items within the section. Lower numbers appear first.
  • itemsFn - A function which will return a table containing multiple table items. See hs.menubar for details.
Returns
  • section - The section the item was added to.
Signature plugins.core.menu.manager.section:addMenu(priority, titleFn) -> section
Type Method
Description Adds a new sub-menu with the specified priority. The section that will contain
Parameters
  • priority - The priority of the item within the section. Lower numbers appear first.
  • titleFn - The function which will return the menu title.
Returns
  • section - The new section that was created.
Signature plugins.core.menu.manager.section:addSection(priority, itemFn) -> section
Type Method
Description Adds a new sub-section with the specified priority. The new sub-section is returned.
Parameters
  • priority - The priority of the item within the section. Lower numbers appear first.
Returns
  • section - The new section that was created.
Signature plugins.core.menu.manager.section:generateTable() -> table
Type Method
Description Generates a new menu table based on the registered items and sections inside this section.
Parameters
  • None
Returns
  • table - The menu table for this section. See hs.menubar for details on the format.
Signature plugins.core.menu.manager.section:new() -> section
Type Method
Description Creates a new menu section, which can have items and sub-menus added to it.
Returns
  • section - The section that was created.