DPanelList.AddItem

From GMod Wiki

Jump to: navigation, search
Function
Syntax DPanelList:AddItem( Panel panel )
Description:
Adds a new item in to a DPanelList.
Returns: nil
In Object: DPanelList
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DPanelList.AddItem]DPanelList.AddItem [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAdds a button in to a DPanelList.
Used onNewerClient.png
Code
 local PanelList = vgui.Create("DPanelList");
 PanelList:SetSize(50, 200);
 PanelList:SetPos(300, 400);
 
 local MyButton = vgui.Create("DButton", PanelList)
 MyButton:SetText("Test button for the list")
 MyButton:SizeToContents();
 
 PanelList:AddItem(MyButton);
OutputA DPanelList with a button in it.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox