Stay organized with collections
Save and categorize content based on your preferences.
blockly > Field > setTooltip
Sets the tooltip for this field.
Signature:
setTooltip(newTip: Tooltip.TipInfo | null): void;
Parameters
Parameter |
Type |
Description |
newTip |
Tooltip.TipInfo | null |
The text for the tooltip, a function that returns the text for the tooltip, a parent object whose tooltip will be used, or null to display the tooltip of the parent block. 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.
[[["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 2024-09-18 UTC."],[[["The `Field.setTooltip()` method allows you to define the tooltip that appears when hovering over a field in a Blockly block."],["You can set the tooltip to a string, a function that returns a string, a parent object with its own tooltip, or null to inherit the parent block's tooltip."],["Passing an empty string to `setTooltip()` will prevent any tooltip from displaying for the field."]]],["The `setTooltip` method in the Field class allows setting a tooltip for a field. It accepts a `newTip` parameter, which can be tooltip text, a function returning the text, a parent object whose tooltip should be used, or `null` to use the parent block's tooltip. Passing an empty string prevents a tooltip from displaying. The method's return type is void.\n"]]