Navigation menu

WoW:API hooksecurefunc: Difference between revisions

Jump to navigation Jump to search
m
Fixed minor typo; exemple to example.
m (→‎Notes: No reason to prefix code with ">". Also, added note about :HookScript() being better than this function when you want to hook a frame's script handler.)
m (Fixed minor typo; exemple to example.)
Line 43: Line 43:
Also note that using hooksecurefunc() may not always produce the expected result. Keep in mind that it actually replaces the original function with a new one (the function reference changes).
Also note that using hooksecurefunc() may not always produce the expected result. Keep in mind that it actually replaces the original function with a new one (the function reference changes).


For exemple, if you try to hook the global function "MacroFrame_OnHide" (after the macro frame has been displayed), your function will not be called when the macro frame is closed.
For example, if you try to hook the global function "MacroFrame_OnHide" (after the macro frame has been displayed), your function will not be called when the macro frame is closed.


It's simply because in Blizzard_MacroUI.xml the OnHide function call is registered like this:
It's simply because in Blizzard_MacroUI.xml the OnHide function call is registered like this:
Anonymous user