Originally Posted by Torhal
Originally Posted by Haleth
Code:
table.insert(UISpecialFrames, yourframehere)
The Blizzard script that closes frames in the UISpecialFrames table uses a SecureCall, and thus shouldn't cause any taint even when the frame is tainted.
|
It won't. I make several frames closable via this method, as do many other AddOn authors. In fact, it's the only real way to do this without taint.
|
Making a frame able to receive key events through
frame:EnableKeyboard() then writing a script for the
OnKeyUp or
OnKeyDown handler to check the key argument passed for the Esc key also works. I've seen some Blizzard frames use this method too.
Code:
frame:EnableKeyboard(1);
frame:SetScript("OnKeyDown",function(self,key)
-- This can be checked for the ESC key, but we'll check for what the keybind uses
if GetBindingFromClick(key)=="TOGGLEGAMEMENU" then
self:Hide();
end
end);