Garry's Mod Wiki

Revision Difference

DTree#515126

<panel>⤶ <parent>DScrollPanel</parent>⤶ <preview>DTree.jpg</preview>⤶ <description>⤶ A tree view element for Derma.⤶ ⤶ See also <page>DTree_Node</page>.⤶ </description>⤶ ⤶ </panel>⤶ ⤶ ⤶ <example>⤶ <description>Example of using DTree</description>⤶ <code>⤶ local frame = vgui.Create( "DFrame" )⤶ frame:SetSize( 300, 500 )⤶ frame:Center()⤶ frame:MakePopup()⤶ ⤶ local dtree = vgui.Create( "DTree", frame )⤶ dtree:Dock( FILL )⤶ ⤶ local node = dtree:AddNode( "Node One" )⤶ local node = dtree:AddNode( "Node Two" )⤶ local cnode = node:AddNode( "Node 2.1" )⤶ local cnode = node:AddNode( "Node 2.2" )⤶ local cnode = node:AddNode( "Node 2.3" )⤶ local cnode = node:AddNode( "Node 2.4" )⤶ local cnode = node:AddNode( "Node 2.5" )⤶ local gcnode = cnode:AddNode( "Node 2.5" )⤶ local cnode = node:AddNode( "Node 2.6" )⤶ local node = dtree:AddNode( "Node Three ( Maps Folder )" )⤶ node:MakeFolder( "maps", "GAME", true )⤶ local node = dtree:AddNode( "Node Four" )⤶ </code>⤶ ⤶ </example>⤶ ⤶