Garry's Mod Wiki

Revision Difference

DListView:GetLines#526432

<function name="GetLines" parent="DListView" type="panelfunc"> <ispanel>yes</ispanel> <description>Gets all of the lines added to the DListView.</description> <realm>Client</realm> <rets> <ret name="" type="table">The lines added to the DListView.</ret> </rets> </function> <example> <description>Loops through all of the lines of a DListView and prints their first value.</description> <code> 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 </code> <output> &lt;pre&lt;noinclude&gt;&lt;/noinclude&gt;&gt;1 Apple⤶ 2 Orange⤶ 3 Banana&lt;/pre&lt;noinclude&gt;&lt;/noinclude&gt;&gt;⤶ 1 Apple<br/>⤶ 2 Orange<br/>⤶ 3 Banana⤶ </output> </example>