DFrame.Close

From GMod Wiki

Jump to: navigation, search
Function
Syntax DFrame:Close( )
Description:
Closes the frame
Returns: nil
In Object: DFrame
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DFrame.Close]DFrame.Close [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreate a frame, with a button. The button will close the frame.
Used onNewerClient.png
Code
 
myParent = vgui.Create("DFrame")
myParent:SetTall( 480 )
myParent:SetWide( 640 )
 
myButton = vgui.Create("DButton", myParent)
myButton:SetText( "Close" )
myButton:SetPos( 50, 50)
myButton:SizeToContents()
myButton.DoClick = function() myParent:Close() end
 
myParent:Center()
myParent:MakePopup()
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox