Refresh a window

Hey guys, Is there anyway of refreashing a DFrame window, or do i need to close and reopen a window?

Not sure if this will work but make a timer?

Do you mean refresh the contents inside of the Panel? Show your code.

currently i have no code, but im planning on changing some labels for example on the DFrame vgui.

I think DLabels refresh when they are changed.

I think he means updating the information when a value changes. What sort of value are you looking to “refresh”? (a player’s ping, etc?)

normally I’d do something like this

local ThingsToRefresh = {}

local base = vgui.Create( "DFrame" )
	base:SetSize( 500, 500 )
	base.Refresh = function()
		for pnl, func in pairs( ThingsToRefresh ) do
			func( pnl )

local label = vgui.Create( "DLabel", base )
	label:Dock( TOP )
	label:SetText( "hello" )
ThingsToRefresh[label] = function( s ) s:SetText( math.random( 20 ) ) end

local button = vgui.Create( "DButton", base )
	button:Dock( BOTTOM )
	button:SetText( "Refresh" )
	button.DoClick = function() base:Refresh() end
local amt = 0
ThingsToRefresh[button] = function( b ) amt = amt + 1; b:SetText( "Refreshed " .. amt .. " times" ) end


or you’d make a function which deletes everything, then lays it out again. depends how far you need to go
you get the idea

for example adding and removing models.