DListView/GetLines

From Garry's Mod
Jump to: navigation, search
 DListView:GetLines( )

Contents

DescriptionPanelFunc

Gets all of the lines added to the DListView.

Returns

table

The lines added to the DListView.

Examples

Example

Loops through all of the lines of a DListView and prints their first value.

local list = vgui.Create( "DListView" )
list:AddColumn( "Fruit" )

local lines = { "Apple", "Orange", "Banana" }

for _, line in pairs( lines ) do
    list:AddLine( line )
end

for k, line in pairs( list:GetLines() ) do
    print( k, line:GetValue( 1 ) )
end

Output:

1 Apple
2 Orange
3 Banana
Personal tools
Navigation