DGrid

From GMod Wiki

Jump to: navigation, search
Derma Control: DGrid
Parent Class:Panel
Subclasses:
Description:
A really simple grid layout panel.

Examples

DescriptionCreates a simple grid with numbered buttons.
Used onNewerClient.png
Code
 
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
 
Output4bbb513028fdf-DGrid.png


Methods

NewerClient.png DGrid.AddItem
NewerClient.png DGrid.RemoveItem
NewerClient.png DGrid.SetCols
NewerClient.png DGrid.SetColWide
NewerClient.png DGrid.SetRowHeight

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox