I have built my own custom component controls. The dropdown list control in particular requires a tooltip to show when hovering over the list items, as some might not fit the list width and should state the entire text in a tooltip (image below). The SetupTooltip
method on the GH_ComponentAttributes
class cannot be used as the dropdown list shows items beyond the component’s layout.
I am currently trying to use the GH_Tooltip
class to show a tooltip, which it does, but it keeps blinking on and off even if the mouse is not moving. I have registered a callback on the mouse move event of the canvas, which calls the following method:
private void setupDropdownItemTooltip() {
GH_Tooltip.AssignTooltipFields(text: m_items[m_highlightedIndex]);
GH_Tooltip.Show(Grasshopper.Instances.ActiveCanvas);
}
The canvas mouse move event keeps firing even if the cursor does not move at all. Are there any suggestions as to which event I should use, how I should handle custom tooltips or how to properly use the GH_Tooltip
class?