Andreas wrote a great post on how to use the hook.
UI contains HookObjectChange(). I want to delete a temporary hook using Unhook() when I close the UI using "ESC". I think there is some kind of handler for closing the UI. Perhaps it is done in a similar way:
Code
local pluginName = select(1,...);
local componentName = select(2,...);
local signalTable = select(3,...);
local myHandle = select(4,...);
local function main()
local screenOverlay = GetFocusDisplay().ScreenOverlay
screenOverlay:ClearUIChildren()
local callFunction = function(object) Echo("Page "..CurrentExecPage().No) end
local hookIndex = HookObjectChange(callFunction, DataPool().Pages, myHandle:Parent())
local baseInput = screenOverlay:Append("BaseInput")
baseInput.W, baseInput.H = "500", "300"
baseInput.ImNeededWhenUICloses = "WhenUICloses"
signalTable.WhenUICloses = function(caller) Unhook(hookIndex) end
end
return main
Display More
How to do it right?