View Single Post
11-26-12, 05:26 AM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Lightbulb

I have a feeling this snippet is redundant (not related to the original enquiry)
Code:
if (frame:GetScript("OnShow")) then
  frame:HookScript("OnShow", hideTab)
else
  frame:SetScript("OnShow", hideTab)
end
:HookScript() should function as :SetScript() automatically if the handler doesn't exist.

So the whole control structure could be simplified to just:
Code:
if frame and not frame.tabHooked then
  frame:HookScript("OnShow", hideTab)
  frame.tabHide = true
  frame.tabHooked = true
  frame:Hide()
end
Edit: Also where is the shown variable defined / gets its value? (used in GetNumActiveChatFrames() function)

Last edited by Dridzt : 11-26-12 at 05:30 AM.
  Reply With Quote