Talk:API C FriendList.SetWhoToUi

Confirming note

 * Note - Hooking FriendsFrame's OnEvent handler is a really bad idea, because FriendsFrame contains the raid tab. This would likely cause you a lot of problems with the new secure framework. Using FriendsFrame:Hide is also probably not a good idea unless you're absolutely sure when your code is going to be run. Otherwise, you may inadvertantly hide the FriendsFrame when the player is using it.

I agree with the above. I hooked the WhoList_Update function instead. This is the function called by the event handler as well as other parts of the code that brings up the FriendsFrame in Who mode. My code is below

OrigWhoList_Update = WhoList_Update; function WhoList_Update if (not SWALLOW_NEXT_WHO) then OrigWhoList_Update; end end

- Hillie (talk) 21:54, 8 May 2008 (UTC)

Okay, in further research of the FrameXML I actually did something different. Not sure if this is better or worse? I basically hooked the OnShow and OnHide methods of the friends frame to register the event on showing the frame and unregistering the event on hiding the frame. I'm currently testing.

Hillie (talk) 00:06, 21 June 2008 (UTC)