Category:DGrid

From Garry's Mod
Jump to: navigation, search

Contents

DescriptionPanelPage

A really simple grid layout panel.

NOTE

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.

Inherited Functions

Inherits the following functions from Panel and its parents up to 3 levels deep:


Examples

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


Pages in category "DGrid"

The following 10 pages are in this category, out of 10 total.

Personal tools
Navigation