Refresh GUI Popup Control Text?

justhal

Chieftain
Joined
Jun 2, 2008
Messages
2
I am doing something like

Code:
ctl = ContextPtr:LookUpControl( "OutputEditBox" );
ctl:SetText( "First" );
sleep( 3 );
ctl:SetText( "Second" );

I'm wanting the edit box to display the text 'First' then after three seconds to display the text 'Second', but what is happening is that only the 'Second' text is displayed. The sleep function is working, it is waiting three seconds, it's just not displaying the first string.

I've tried putting print statements in to ensure that the statements are executed in the correct order, but that doesn't seem to help. I've also tried using the following statements:
Code:
UI.MakeInterfaceDirty()
UI.SetDirty( true )

but I get the same result.

I got the sleep function from a Lua reference. The code for that is:

Code:
local clock = os.clock
function sleep(n)  -- seconds
  local t0 = clock()
  while clock() - t0 <= n do end
end

Is there a built-in sleep function? I wasn't able to find one.

Sorry for being so long-winded. Basically, I'm wanting to display one message, pause for a few seconds, then display another message in place of the first one.

Anyone have any ideas that might help?

Thanks in advance.
 
Back
Top Bottom