View Single Post
12/02/14, 11:40 PM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,016
Originally Posted by merlight View Post
When I wanted to know that the Research tab was shown, I hooked OnEffectivelyShown handler on the panel control:
Lua Code:
  1. ZO_PreHookHandler(SMITHING.researchPanel.control, "OnEffectivelyShown", ...)
  2. -- actually it was a post-hook in my code, but I don't remember why
I think I know why you've made it as a post hook:
The deconstruction, improvement, and ther panels won't be shown directly if you press the button to change it, or as the OnEfectivelyShown() function was called.
There is sometimes a slight delay before you can use e.g. IsHidden().
Either you put your function as a post hook, so everything else was done before your check "where am I?", or you try it with zo_callLater and about 50ms.
  Reply With Quote