# SANDBOX:PopulateContent

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/SANDBOX:PopulateContent
- **Çeviri tarihi:** 2025-09-08

```lua
SANDBOX:PopulateContent( Panel pnlContent, Panel tree, Panel node )
```

## Açıklama

İçerik (content) sekmesi oluşturulduğunda spawnmenu tarafından çağrılır.

> **UYARI:** Bu Hook içerisinde hata oluşturmak, İçerik Sekmesinin tamamen bozulmasına neden olacaktır.

## Argümanlar

1. [Panel](https://gmod.tr/wiki/Panel) **pnlContent**: SpawnmenuContentPanel paneli
2. [Panel](https://gmod.tr/wiki/Panel) **tree**: SpawnmenuContentPanel'den gelen ContentNavBar ağacı
3. [Panel](https://gmod.tr/wiki/Panel) **node**: Eski Spawnlist'ler (spawn listeleri)

### Örnek

Modeller (Models) paneli ile bir Örnek Kategorisi oluşturur.

```lua
hook.Add( "PopulateContent", "Example", function( pnlContent, tree, node )
	local ViewPanel = vgui.Create( "ContentContainer", pnlContent )
	ViewPanel:SetVisible( false )
	ViewPanel.IconList:SetReadOnly( true )

	ExampleNode = node:AddNode( "Example", "icon16/folder_database.png" )
	ExampleNode.pnlContent = pnlContent
	ExampleNode.ViewPanel = ViewPanel

	local models = ExampleNode:AddNode( "Models", "icon16/exclamation.png" )
	models.DoClick = function()
		ViewPanel:Clear( true )

		local cp = spawnmenu.GetContentType( "model" )
		if cp then
			for k, v in ipairs( file.Find( "models/*.mdl", "GAME" ) ) do
				cp( ViewPanel, { model = "models/" .. v } )
			end
		end

		ExampleNode.pnlContent:SwitchPanel( ViewPanel )
	end
end)
```

**Çıktı:** ![](https://gmod.tr/api/uploads/wiki/cb892bca8e3c566ca45a.png)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/SANDBOX:PopulateContent
