• Closing a GUI problems.
    5 replies, posted
Hey guys, well I have a problem, I have this code to close a GUI, it worked the other week but now I went to test it and it doesn't could someone point me in the right direction to why this isn't closing. [lua] local Button_Close = vgui.Create( "DButton", FrameInv ) Button_Close:SetPos( 2, FrameInv:GetTall( ) - 25 ) Button_Close:SetSize( FrameInv:GetWide( ) - 4, 20 ) Button_Close:SetText( "Close" ) Button_Close.DoClick = function( ) InvCloseFrame( ) end end function InvCloseFrame( ) if ( FrameInv ) then FrameInv:SetVisible( false ) FrameInv = nil end end[/lua]
Post the entire code please and an error if there is one, because there is no problem with what you've posted so far.
No errors, and none of my other code will cause it, its something to do with that.
Why are you doing: FrameInv:SetVisible(false) FrameInv = nil FramInv:SetVisible(false) would suffice nilling it is just a waste. [QUOTE=samwilki;24050498]No errors, and none of my other code will cause it, its something to do with that.[/QUOTE] Yea your totally right, I'm just asking to see your code because I want to steal it, not that I'm trying to help you or anything.
[QUOTE=Averice;24051245]FramInv:SetVisible(false) would suffice nilling it is just a waste.[/QUOTE] Not if he wants to get rid of the frame.
[QUOTE=Overv;24051564]Not if he wants to get rid of the frame.[/QUOTE] I assumed since he used SetVisible then nulled it that he might have been trying to reuse it without remaking it. Otherwise he could of used: FrameInv:Remove() Although there isn't much difference.
Sorry, you need to Log In to post a reply to this thread.