Garry's Mod Wiki

ContentSidebarToolbox

Description

This is used internally - although you're able to use it you probably shouldn't.

The ContentSidebarToolbox is internally used by the ContentSidebar and is used to change the icon of a category. It internally consists of a DTextEntry, DPanel, DImageButton, Panel, ContentHeader and a DIconBrowser

Parent

Derives methods, etc not listed on this page from DDrawer.

Implements

Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.

Example

How to create a

Frame = vgui.Create("DFrame") Frame:SetSize(ScrW() / 2, ScrH() / 2) Frame:Center() Frame:MakePopup() ContentSidebar = vgui.Create( "ContentSidebar", Frame) ContentSidebar:Dock(FILL) ContentSidebar:CreateSaveNotification() for k=1, 6 do local Node = ContentSidebar.Tree:AddNode("Example", "icon16/user.png") Node:SetHideExpander(true) Node:SetExpanded(true) Node.DoClick = function(self) hook.Call("SpawnlistContentChanged", GAMEMODE or GM) end for v=1, math.random(1, 5) do Node:AddNode("Example", "icon16/star.png") end end