I made a minimal example for testing at runtime. The button does change visually when clicked so the mouse is detected but no tooltip pops up. Am I missing some code? Any suggestions?
void Start() {
var uiDoc= GetComponent<UIDocument>();
var rootVE = uiDoc.rootVisualElement;
var ve2 = new Button();
ve2.style.width = 200;
ve2.style.height = 200;
ve2.style.backgroundColor = Color.black;
ve2.tooltip = "A toolTip";
rootVE.Add(ve2);
}