DListView.RemoveLine

From GMod Wiki

Jump to: navigation, search
Function
Syntax DListView:RemoveLine( Integer Line )
Description:
Removes the specified line from a DListView.
Returns: nil
In Object: DListView
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DListView.RemoveLine]DListView.RemoveLine [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionRemove the third line (Tony) from the list of names.
Used onNewerClient.png
Code
nametable = {
	"John",
	"Bob",
	"Tony",
	"Spencer Henslol (That cool guy)",
	"Joseph",
	"Pikachu"
	} //Cute little table of some names.
 
frame = vgui.Create("DFrame") // Create base frame to put the DListView on.
	frame:SetSize(400,400)
	frame:SetPos(100,100)
 
listmenu = vgui.Create("DListView") // Create the DListView
	listmenu:SetParent(frame)
	listmenu:SetSize(300,300)
	listmenu:SetPos(5,20)
	listmenu:AddColumn("Name") // Add a Column with the name 'Name'
 
for k,v in pairs(nametable) do // For every item in the nametable table,  do the following:
	listmenu:AddLine(v)        // Add the string from the table, to a new row on the DListView.
end
 
function DeleteRow()
	listmenu:RemoveLine(3) // Remove the third row from the DListView
end
 
concommand.Add("DeleteRow",DeleteRow) //Add a "DeleteRow" command to console to remove the third row.
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox