Made Label in derma, says "Label" instead of what I what it to say

http://img267.imageshack.us/img267/3994/2011112600001.jpg

Uploaded with ImageShack.us

Here’s the relevant code
[lua]local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 450, 50 ) – Keep the second number at 50
Proplist1:SetLabel( “Groups” )

local group1 = vgui.Create(“Label”, groupslist)
group1:SetPos(1,1)
group1:SetText(groups[1])
group1:SizeToContents() [/lua]

No error messages, and I tried changing the group1:SetText(groups[1]) to group1:SetText(Civil Service), but it had no effect whatsoever.

If you can’t see it, there’s a little bit of white writing saying “Civil Service” behind the word “Label”, but I really want to remove that “Label” thing so people can see what I want them to see. Let me know if you want me to post more code.

I tried changing it to DLabel, but it had no effect besides removing the “Civil Service” text in the background, so it just says “Label” now.

Thanks!

try using DLabel

I did, but it had no effect besides removing the “Civil Service” text in the background, so it just says “Label” now.

Edit: I added a “SetColor” to it, which made the text in the background behind the “Label” text visible again, so there was no effect at all, it still looks like the image at the top of the OP

[lua]local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 450, 50 ) – Keep the second number at 50
Proplist1:SetLabel( “Groups” )

local group1 = vgui.Create(“DLabel”, groupslist)
group1:SetPos(1,1)
group1:SetColor(Color(255,255,255,255))
group1:SetFont(“default”)
group1:SetText(“Civil Service”)
group1:SizeToContents() [/lua]

Here’s the whole cl_init.lua file:

[lua]// Clientside only stuff goes here
function ShowTeamMenu()
local DermaPanel = vgui.Create( “DFrame” ) – Creates the frame itself
DermaPanel:SetPos( 80,80 ) – Position on the players screen
DermaPanel:SetSize( 600, 500 ) – Size of the frame
DermaPanel:SetTitle( “Main Menu” ) – Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) – Draggable by mouse?
DermaPanel:ShowCloseButton( true ) – Show the close button?
DermaPanel:MakePopup() – Show the frame

local TestingPanel = vgui.Create( “DPanel”, DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 550, 50 )
TestingPanel.Paint = function() – Paint function
surface.SetDrawColor( 50, 50, 50, 255 ) – Set our rect color below us; we do this so you can see items added to this panel
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) – Draw the rect
surface.DrawText( “Message of the Day: Zyler Rocks!” )
end

local PropertySheet = vgui.Create( “DPropertySheet” )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 25, 110 )
PropertySheet:SetSize( 550, 315 )

local Welcome = vgui.Create( “DLabel” )
Welcome:SetText( “A” )
Welcome:SetColor(Color(191,255,0,255))
Welcome:SizeToContents()

local Character = vgui.Create( “DPanel” )
Character:SetSize( 305, 305 )
Character.paint = function()
surface.SetDrawColor(Color(191,255,0,255))
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
surface.DrawText( “Characters” )
end

local Props = vgui.Create( “DPanel” )
Props:SetSize( 305, 305 )
Props.paint = function()
surface.SetDrawColor(Color(191,255,0,255))
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
surface.DrawText( “Pick props to spawn” )
end

local food = {}

    food[1] = "models/props_junk/garbage_milkcarton002a.mdl"
food[2] = "models/props_junk/PopCan01a.mdl"
food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl"
food[4] = "models/props_junk/watermelon01.mdl"
food[5] = "models/props_junk/garbage_metalcan001a.mdl"
food[6] = "models/props_lab/box01a.mdl"
food[7] = "models/props_lab/box01b.mdl"

local Proplist1 = vgui.Create(“DCollapsibleCategory”, Props)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 450, 50 ) – Keep the second number at 50
Proplist1:SetLabel( “Proplist1” )

Proplist1menu = vgui.Create(“DModelSelect”, Proplist1 )
Proplist1menu:SetSize( 300, 300 )
Proplist1menu:SetSpacing( 5 )
Proplist1menu:EnableHorizontal( true )
Proplist1menu:EnableVerticalScrollbar( false )
Proplist1menu:SetPadding( 4 )

for k,v in pairs(food) do
local icon = vgui.Create( “SpawnIcon”, Proplist1menu )
icon:SetModel( v )
Proplist1menu:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( “ui/buttonclickrelease.wav” ) RunConsoleCommand(“gm_spawn”, v)
end
end
Proplist1:SetContents(Proplist1menu)
PropertySheet:AddSheet( “Welcome”, Welcome, “gui/silkicons/user”, false, false, “Rules and stuff” )
PropertySheet:AddSheet( “Character/Groups”, Character, “gui/silkicons/group”, false, false, “Manage your character and groups” )
PropertySheet:AddSheet( “Props/Tools”, Props, “gui/silkicons/group”, false, false, “Get Props and Tools” )

local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 450, 50 ) – Keep the second number at 50
Proplist1:SetLabel( “Groups” )

local group1 = vgui.Create(“DLabel”, groupslist)
group1:SetPos(1,1)
group1:SetColor(Color(255,255,255,255))
group1:SetFont(“default”)
group1:SetText(“Civil Service”)
group1:SizeToContents()

end

usermessage.Hook( “call_vgui”, ShowTeamMenu )[/lua]

[lua]
local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 450, 50 ) – Keep the second number at 50
Proplist1:SetLabel( “Groups” )
[/lua]

the control you’re creating is named ‘groupslist’ but the rest is ‘Proplist1’ ?

That’s cause I copy+pasted it, I’ll fix that and see if it works

edit:
Fixed the Collaspible Category, but still not the label

http://img17.imageshack.us/img17/8148/2011112600003.jpg

Uploaded with ImageShack.us

here’s the code:
[lua]local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
groupslist:SetPos(25, 50)
groupslist:SetSize( 450, 50 ) – Keep the second number at 50
groupslist:SetLabel( “Groups” )

local group1 = vgui.Create(“DLabel”, groupslist)
group1:SetPos(1,1)
group1:SetColor(Color(255,255,255,255))
group1:SetFont(“default”)
group1:SetText(“Civil Service”)
group1:SizeToContents() [/lua]

add groupslist:SetContents(group1)

gives me this:
http://img803.imageshack.us/img803/2931/2011112600004.jpg

Uploaded with ImageShack.us

http://img819.imageshack.us/img819/4977/2011112600005k.jpg

Uploaded with ImageShack.us

The label doesn’t appear.

the code:
[lua]local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
groupslist:SetPos(25, 50)
groupslist:SetSize( 450, 50 ) – Keep the second number at 50
groupslist:SetLabel( “Groups” )
groupslist:SetContents(group1)

local group1 = vgui.Create(“DLabel”, groupslist)
group1:SetPos(1,1)
group1:SetColor(Color(255,255,255,255))
group1:SetFont(“default”)
group1:SetText(groups[1])
group1:SizeToContents() [/lua]

[lua]
local groups = {}
groups[1] = “Civil Service”
groups[2] = “Government”
groups[3] = “Employable”

local groupslist = vgui.Create(“DCollapsibleCategory”, Character)
groupslist:SetPos(25, 50)
groupslist:SetSize( 450, 50 ) – Keep the second number at 50
groupslist:SetLabel( “Groups” )

local group1 = vgui.Create(“DLabel”)
group1:SetPos(1,1)
group1:SetColor(Color(255,255,255,255))
group1:SetFont(“default”)
group1:SetText(groups[1])
group1:SizeToContents()

groupslist:SetContents(group1)
[/lua]

Thankyou so much, it works!