Hooking an on enter event to a standard UI element
for an add on Enhancement I'm working on I need to hook an on enter event to MainMenuBarMackpackButton but my experaince is limited and I'm having trouble with this. is it even possible to hook an event to a frame the ad don didn't create?
If not I may have to poll the size of MainMenuBarMackpackButton and create an invisible frame over the MainMenuBarMackpackButton and use an on enter event for that frame. For efficient code if I do not need to create a frame I do not want to.
MainMenuBarBackpackButton:HookScript("OnEnter", function(self) do stuff end)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh
Also, "polling" has a fairly specific meaning in WoW addon programming, and would refer to the process of using an OnUpdate script to check for changing conditions (as opposed to listening for and responding to events that fire when conditions change). A one-time API call to obtain a value (such as the dimension of a frame) wouldn't be described that way.