Ui Button: call function "on pointer enter", all at runtime

So I have the code to create buttons at runtime. Now I’m trying to call a specific function when the mouse pointer enters the button.

For clicks on the button (UnityEngine.UI.Button) it is very simple:
button.onClick.AddListener(delegate
{
// Any code here
});


But how does one do this in a simple way for “on pointer enter” events?


Basically I am looking for something like:
button.onPointerEnter.AddListener(delegate
{
// Create tooltip
});

Over a quick google search, the answer was my second result.

This answer discusses adding an event listener for pointer events.

This video shows how to call a function from a script using the OnPointerDown event: