Garry's Mod Wiki

Garry's Mod Wiki

  DListView_Column:SetWidth( number width )

Description

Sets the width of the panel.

Arguments

1 number width
The number value which will determine panel width.

Example

Creates a DListView and populates it with two columns and two items, only one of which can be selected at a time.

The first column width is 15. The second column width is 350.

local Frame = vgui.Create( "DFrame" ) Frame:SetSize( 500, 500 ) Frame:Center() Frame:MakePopup() local SimpleList = vgui.Create( "DListView", Frame ) SimpleList:Dock( FILL ) SimpleList:SetMultiSelect( false ) SimpleList:AddColumn( "Column 1" ):SetWidth(15) SimpleList:AddColumn( "Column 2" ):SetWidth(350) SimpleList:AddLine( "First", "Column" ) SimpleList:AddLine( "Second", "Column" )
Output:

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...