DListView.Clear

From GMod Wiki

Jump to: navigation, search
Function
Syntax DListView.Clear( )
Where is this used?
Description:
Clears the whole listview
Returns: nil
Part of Library: DListView
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DListView.Clear]DListView.Clear [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionRemoves all rows from the list when a row is clicked.
Used onNewerClient.png
Code
local DList = vgui.Create ( "DListView" )
DList:SetPos(25,25)
DList:SetSize(50,50)
DList:SetMultiSelect(false)
DList:AddColumn("Column 1")
DList:AddColumn("Column 2")
DList:AddLine("Test 1","Test 2")
DList:AddLine("Test 3","Test 4")
DList:AddLine("Test 5","Test 6")
DList.OnClickLine = function(parent,selected,isselected) parent:Clear() end
OutputAll lines that have been added to the DListView will be removed whenever any line is clicked.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox