Stay organized with collections
Save and categorize content based on your preferences.
blockly > Menu
A basic menu class.
Signature:
export declare class Menu
Constructors
Constructor |
Modifiers |
Description |
(constructor)() |
|
Constructs a new Menu instance. |
Properties
Property |
Modifiers |
Type |
Description |
openingCoords |
|
Coordinate | null |
Coordinates of the pointerdown event that caused this menu to open. Used to prevent the consequent pointerup event due to a simple click from activating a menu item immediately. |
Methods
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMenu\u003c/code\u003e class in Blockly provides a basic structure for creating menus within the Blockly editor.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003eopeningCoords\u003c/code\u003e to track the mouse event that triggered the menu opening and methods like \u003ccode\u003edispose\u003c/code\u003e and \u003ccode\u003erender\u003c/code\u003e for managing the menu's lifecycle and appearance.\u003c/p\u003e\n"],["\u003cp\u003eThe constructor initializes a new \u003ccode\u003eMenu\u003c/code\u003e instance, while properties and methods offer control over its behavior and interactions.\u003c/p\u003e\n"]]],["The `Menu` class provides a basic menu structure. Key actions include constructing a new `Menu` instance, which is done via the constructor. The class has a `openingCoords` property to track the coordinates of the initiating mouse event. It includes methods to `dispose` of the menu and `render` it, which involves creating the necessary DOM elements.\n"],null,["[blockly](./blockly.md) \\\u003e [Menu](./blockly.menu_class.md)\n\nMenu class\n----------\n\nA basic menu class.\n\n**Signature:** \n\n export declare class Menu \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------|-----------|---------------------------------|\n| [(constructor)()](./blockly.menu_class._constructor__1_constructor.md) | | Constructs a new Menu instance. |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------------------------|-----------|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [openingCoords](./blockly.menu_class.openingcoords_property.md) | | [Coordinate](./blockly.utils_namespace.coordinate_class.md) \\| null | Coordinates of the pointerdown event that caused this menu to open. Used to prevent the consequent pointerup event due to a simple click from activating a menu item immediately. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------|-----------|-----------------------|\n| [dispose()](./blockly.menu_class.dispose_1_method.md) | | Dispose of this menu. |\n| [render(container)](./blockly.menu_class.render_1_method.md) | | Creates the menu DOM. |"]]