Im having this really weird issue with DButtons where if i parent the button to [I]Anything[/I] the button becomes unclickable
This is the function i use to create the button
[CODE]function CreateButton(x, y, w, h, t, db, bc, p)
p = p or nil
Index[Count(Index)+1] = vgui.Create("DPanel", p)
Index[Count(Index)]:SetPos(x, y)
Index[Count(Index)]:SetSize(w, h)
Index[Count(Index)]:SetBackgroundColor(bc)
Index[Count(Index)+1] = vgui.Create("DButton", p)
Index[Count(Index)]:SetPos(x, y)
Index[Count(Index)]:SetSize(w, h)
Index[Count(Index)]:SetText(t)
--Index[Count(Index)]:SetFont("Font1")
Index[Count(Index)]:SetTextColor(white)
Index[Count(Index)]:SetDrawBackground(db)
return Index[Count(Index)]
end[/CODE]
The first panel is to make a nice looking panel and a hidden button on top. All help appreciated
[highlight](User was banned for this post ("Wrong section, try Developer Discussion next time" - Shendow))[/highlight]
Use DFrame, not dpanel, either way you will have to run SetEnableMouseInput and MakePopup()
Also SetDrawBackground is deprecated. Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/DPanel/SetPaintBackground]DPanel:SetPaintBackground[/url]
Sorry, you need to Log In to post a reply to this thread.