View Single Post
01-23-10, 05:10 PM   #79
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
This seems to work (though I don't have the "tFlags" part of your code)

Code:
local function myWatchFrame_Collapse(self)
    print("In my Collapse Function");
    if ( WatchFrameScrollFrame and not tFlags.nUI_InfoPanel ) then        
        WatchFrameScrollFrame:SetHeight( WatchFrame:GetHeight() );
    end
end

local function myWatchFrame_Expand(self)
    print("In my Expand Function");
    if ( WatchFrameScrollFrame and not tFlags.nUI_InfoPanel ) then        
        WatchFrameScrollFrame:SetHeight( tValues.height );
    end
end

hooksecurefunc( "WatchFrame_Collapse", myWatchFrame_Collapse );
hooksecurefunc( "WatchFrame_Expand", myWatchFrame_Expand );
EDIT: Note... you don't have to make the call to WatchFrame_Collapse() or WatchFrame_Expand() because your function doesn't get called until AFTER the "hooked" function has been executed... it does not replace the function, it just causes your function to be called after the hooked function is executed.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/

Last edited by spiel2001 : 01-23-10 at 05:12 PM.