Garry's Mod Wiki

DListView_Column:SetMinWidth

  DListView_Column:SetMinWidth( number width )

Description

Sets the minimum width of a column.

Arguments

1 number width
The number value which will determine a minimum 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 second column can't be smaller than the argument value.

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" ) SimpleList:AddColumn( "Column 2" ):SetMinWidth(125) SimpleList:AddLine( "First", "Column" ) SimpleList:AddLine( "Second", "Column" )
Output: