blockly > Block > setTooltip
Sets the tooltip for this block.
Signature:
setTooltip(newTip: Tooltip.TipInfo): void;
Parameters
Parameter |
Type |
Description |
newTip |
Tooltip.TipInfo |
The text for the tooltip, a function that returns the text for the tooltip, or a parent object whose tooltip will be used. To not display a tooltip pass the empty string. |
Returns:
void
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 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Block.setTooltip()` method allows you to assign a tooltip to a specific block in Blockly."],["Tooltips can be defined using text, a function that returns text, or by inheriting from a parent object; providing an empty string suppresses the tooltip."],["Calling `setTooltip()` with the desired tooltip information updates the block's tooltip accordingly."]]],["The `Block.setTooltip()` method sets a block's tooltip. It accepts a `Tooltip.TipInfo` parameter, which can be a text string, a function returning the tooltip text, or a parent object whose tooltip should be used. To disable the tooltip, an empty string should be passed as parameter. The method returns nothing (`void`) after setting the tooltip.\n"]]