Skip to main content

blockly > icons > WarningIcon

icons.WarningIcon class

An icon that warns the user that something is wrong with their block.

For example, this could be used to warn them about incorrect field values, or incorrect placement of the block (putting it somewhere it doesn't belong).

Signature:

export declare class WarningIcon extends Icon implements IHasBubble 

Extends: Icon

Implements: IHasBubble

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the WarningIcon class.

Properties

Property

Modifiers

Type

Description

sourceBlock

protected

readonly

BlockSvg

TYPE

static

readonly

IconType<WarningIcon>

The type string used to identify this icon.

WEIGHT

static

readonly

(not declared)

The weight this icon has relative to other icons. Icons with more positive weight values are rendered farther toward the end of the block.

Methods

Method

Modifiers

Description

applyColour()

bubbleIsVisible()

dispose()

getBubble()

See IHasBubble.getBubble.

getSize()

getType()

getWeight()

initView(pointerdownListener)

isClickableInFlyout()

isShownWhenCollapsed()

Tells blockly that this icon is shown when the block is collapsed.

onClick()

Toggles the visibility of the bubble.

onLocationChange(blockOrigin)

Updates the location of the icon's bubble if it is open.

setBubbleVisible(visible)

updateCollapsed()