Table of Contents

Method SetToolTip

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

SetToolTip(View, string)

Sets the tooltip text for the specified view.

public void SetToolTip(View target, string text)

Parameters

target View

The view to associate with the tooltip. Cannot be null.

text string

The text to display in the tooltip. Cannot be null.

SetToolTip(View, Func<string>)

Associates a tooltip with the specified view, using a delegate to dynamically provide the tooltip text.

public void SetToolTip(View target, Func<string> textFactory)

Parameters

target View

The view to which the tooltip will be attached. Cannot be null.

textFactory Func<string>

A delegate that returns the tooltip text to display. Cannot be null. The delegate is invoked each time the tooltip is shown.

Remarks

Use this method when the tooltip text may change over time or depends on runtime conditions. The tooltip text is evaluated on demand by calling the provided delegate.

SetToolTip(View, Func<View>)

Associates a tooltip with the specified target view using a factory function to generate the tooltip content.

public void SetToolTip(View target, Func<View> contentFactory)

Parameters

target View

The view to which the tooltip will be attached. Cannot be null.

contentFactory Func<View>

A function that returns the view to be used as the tooltip content. Cannot be null.

Remarks

The tooltip content is created on demand by invoking the provided factory function each time the tooltip is displayed. This allows for dynamic or context-sensitive tooltip content.