Hello, I was playing around a bit with the DCollapsibleCategory, it works fine, except when I close it, and reopen it, then its bugged, it wont open, but instead get half the normal height.
heres the code:
[CODE]local function frame()
local frame = vgui.Create("DFrame")
frame:SetSize(ScrW()/4, ScrH())
frame:SetPos(ScrW() / 2, 0)
frame:SetTitle("Whites menu")
local list = vgui.Create("DScrollPanel", frame)
list:SetSize(frame:GetWide(), frame:GetTall())
list:SetPos(0, 25)
local c_radar = vgui.Create("DCollapsibleCategory", frame)
c_radar:SetSize(list:GetWide(), 200)
c_radar:SetLabel("Radar")
c_radar:SetExpanded(0)
list:AddItem(c_radar)
local radarlist = vgui.Create("DScrollPanel", c_radar)
c_radar:SetContents(radarlist)
local radartoggle = vgui.Create("DCheckBoxLabel", radarlist)
radartoggle:SetText("Toggle Radars")
radartoggle:SetConVar("enableradars")
radartoggle:SizeToContents()
radarlist:AddItem(radartoggle)
frame:MakePopup()
end
concommand.Add("w_menu", function(ply)
frame()
end)[/CODE]
Is there any reason you are doing this:
[code]
concommand.Add("w_menu", function(ply)
frame()
end)
[/code]
instead of this:?
[code]
concommand.Add("w_menu", frame)
[/code]
i just encountered this problem too, shits fucked up yo
It's a bug. I've sent a pull request with a fix: [url]https://github.com/garrynewman/garrysmod/pull/1007[/url]
[QUOTE=Voluptious;48132684]Is there any reason you are doing this:
[code]
concommand.Add("w_menu", function(ply)
frame()
end)
[/code]
instead of this:?
[code]
concommand.Add("w_menu", frame)
[/code][/QUOTE]
because sometimes when I tried using your method, the frame got fucked up, like it was directly on the hud and not closeable anymore.
[QUOTE=Bo98;48133281]It's a bug. I've sent a pull request with a fix: [url]https://github.com/garrynewman/garrysmod/pull/1007[/url][/QUOTE]
But how come some addons still work with collapsable categories? like in DarkRP some F4 Menus.
Bump ;-;
Sorry, you need to Log In to post a reply to this thread.