PerformLayout & InvalidateLayout question.

Could someone please tell me what it does in details?

And show me a example of it?

I basicly want to add it to my DFrame. So trough my DListView when I ban or Kick an person I don’t want the admin to close the menu and then re-open it.
Instead I want him to be able to see the change directly.

PerformLayout is where all the child elements parented to your panel should be positioned, if not they will be set at 0, 0.
InvalidateLayout is called to invalidate the current layout and force PerformLayout to be called.

Oh, I think I get it. Could you show me a simple example of it? GMod wiki isn’t having a example of it.

[lua]local PANEL = {}

function PANEL:Init()
self.Label = vgui.Create(“DLabel”, self)
self:InvalidateLayout()
end

function PANEL:PerformLayout()
self.Label:SetSize(100, 10)
self.Label:SetPos(10, 10)
end

– Register panel etc[/lua]

That’s just a simple example, hopefully it helps.

[editline]18th January 2011[/editline]

I’m assuming you are making your own panel.

[editline]18th January 2011[/editline]

Oh, I read your post again and you want to add it to the DFrame. Disregard what I just posted.

It’s fine. Does it even work on a DFrame?

Anyone?