Thread Tools Display Modes
12-11-10, 04:25 PM   #1
lgweaver
A Defias Bandit
 
lgweaver's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 1
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.
  Reply With Quote
12-11-10, 09:25 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
These are scripts, not events.

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

  Reply With Quote
12-12-10, 04:06 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hooking an on enter event to a standard UI element

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off