Starting thread for a splash window

I’m not sure when I posted a question about a Splash screen in the Real Software forum, but it was quite a long time ago.
What I got was 2 objects - a window called Splash and a Thread called ThdSplash.
For some reason things changed with New or something else and it doesn’t work anymore.
In the Run event for ThdSplash the first line of code fails and I’d only and simply like to learn why. It’s apparently better to run a timer in a window but this is confusing.

 dim wsplash As new Splash

The calling for this is in another window and goes like this:

Dim OpnDictSplash As New ThdSplash OpnDictSplash.WinText = "Loading Dictionary Files" OpnDictSplash.Run
The ThdSplash Window code from XOJO Window is:

[code]#tag Class
Protected Class ThdSplash
Inherits Thread
#tag Event
Sub Run()
dim wsplash As new Splash

	  wsplash.StaticTxt.Text = me.WinText
	  me.Priority = 50
	  wsplash.show
	  wsplash.Refresh
	  
	  me.Priority = 6
	  While me.Needed
	    wsplash.StaticTxt.Text = me.WinText
	    wsplash.Refresh
	  Wend
	  wsplash.close
	  me.Kill
	End Sub
#tag EndEvent


#tag Property, Flags = &h0
	#tag Note
		Can't use me.Suspended so it's Needed
	#tag EndNote
	Needed As Boolean = True
#tag EndProperty

#tag Property, Flags = &h0
	#tag Note
		Contains the text for Splashscreen
	#tag EndNote
	WinText As String
#tag EndProperty[/code]

The code for the Splash window is simple

[code]#tag WindowCode
#tag Event
Sub Close()
me.Close
End Sub
#tag EndEvent

#tag Event
	Sub Open()
	  self.top =  (Screen(0).availableHeight - self.Height)\\2
	  self.left = (Screen(0).availablewidth - self.Width)\\2
	  
	End Sub
#tag EndEvent

#tag EndWindowCode[/code]

You update the UI from a thread, which is not allowed.
You should get a Exception telling you so. The debugger will show this when it detects the Exception.

I wish it was because I would not have bothered. Thanks

What is the purpose of this code? What are you trying to accomplish? When is Needed ever set to False?

It’s like Derk guessed. I’m updating the UI

You may simply add a timer with low period on the splash window.
Make a property or more on the window
have the thread update the properties and the timer read them and set them in the ide controls.

So. Basically reverse the setup. All the thread does is feed the change. Thanks. And that allows the thread to not be involved in the UI. I’ll test it later