Creating tooltips

<element id="button">
  <button>
    <element>
      <label type="theme_text">Calculate</label>
    </element>
  </button>

  <tooltip_name>button_tooltip</tooltip_name>
  <tooltip_type>grid</tooltip_type>
</element>

// ...

<layout id="button_tooltip" type="grid">
  <append_row>
    <name>button_tooltip_row</name>
  </append_row>
</layout>

<factory id="button_tooltip_row" type="grid">
  <element>
    <label type="theme_text">Lorem ipsum dolor sit amet</label>
  </element>
</factory>

elements and containers can have an optional tooltip_name. A layout with a matching id defines the tooltip's layout manager. The required tooltip_type must match the layout's type.

Note

Use tooltip_config instead of config to specify layout manager-specific configuration settings.

As explained in the section called “Tooltips” the actual tooltip gets created when the tooltip becomes visible. This uses create_custom_tooltip() to install a callback that executes the referenced factory to create the actual tooltip. The factory execution uses an empty x::w::const_uigenerators object (the one that created the original widget, to which the tooltip is attached to, is just a distant memory).

<tooltip_appearance>custom_tooltip_appearance</tooltip_appearance>

The optional tooltip_appearance sets a custom tooltip appearance object.

Note

Only supported theme widgets have these tooltip attributes. named element widgets are under the callbacks' control and only the callbacks can set their tooltips.

tooltips' contents are the same as label widget's label. This is equivalent to using a widget's create_tooltip() to create a basic, label tooltip.

<container tooltip="container-tooltip">

    ...

</container>

<tooltip type="label" id="container-tooltip">

   ...

</tooltip>

container elements also have optional tooltip attributes.