WoWInterface - View Single Post - How can I hooksecurefunc with colon like this: "MainMenuBarMixin:OnShow"
View Single Post
08-19-18, 04:36 PM   #2
A Molten Giant
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 578
Anything with "mixin" in it's name isn't actually used directly, so if you were to hook that function, the hook won't get called. You'll need to hook the actual method on the frame that uses the mixin.

Mixins are a template of methods that frames then inherit. Blizzard gives frames a mixin template in two ways: calling frame = CreateFromMixins(mixin) or in xml using the mixin="" attribute. In this case, MainMenuBar gets its methods from MainMenuBar.xml:

XML Code:
  1. <Frame name="MainMenuBar" enableMouse="true" parent="UIParent" mixin="MainMenuBarMixin">

You should be able to do this:

Lua Code:
  1. hooksecurefunc(MainMenuBar, "SetPositionForStatusBars", Test)
  Reply With Quote