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]