Garry's Mod Wiki

Revision Difference

DListView:GetLines#518178

<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> &amp;lt;pre&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;gt;1 Apple &lt;pre&lt;noinclude&gt;&lt;/noinclude&gt;&gt;1 Apple 2 Orange 3 Banana&amp;lt;/pre&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;gt; 3 Banana&lt;/pre&lt;noinclude&gt;&lt;/noinclude&gt;&gt; </output> </example>