Thread: OnLeave & Frame
View Single Post
01-04-17, 08:45 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Vrul View Post
Menu:SetScript('OnLeave', Menu.Hide)
Why this works and what it does:

You're setting the frame handler to be the :Hide() metamethod. As this isn't a function call, just passing a function pointer, it loses the internal self argument. Frames just happen to push themselves as the first argument to their handlers, so everything works out anyway.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote