Garry's Mod Wiki

DGrid

Description

A really simple grid layout panel.

This panel will set its size automatically based on set column count. This makes it play badly with Panel:Dock and cause a PANEL:PerformLayout call every frame.

Parent

Derives from Panel.

Example

Creates a simple grid with numbered buttons.

local frame = vgui.Create( "DFrame" ) frame:SetPos( 500, 500 ) frame:SetSize( 200, 300 ) frame:SetTitle( "Frame" ) frame:MakePopup() local grid = vgui.Create( "DGrid", frame ) grid:SetPos( 10, 30 ) grid:SetCols( 5 ) grid:SetColWide( 36 ) for i = 1, 30 do local but = vgui.Create( "DButton" ) but:SetText( i ) but:SetSize( 30, 20 ) grid:AddItem( but ) end

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 3
Generate Html 5
SaveChanges (1) 10
Render Body 0
Render Sidebar 11