Using a webtimer for splash screen

Hi all,

I’m experimenting, and since I’m very new to xojo, I’m probably screwing something up :slight_smile:

I have a small app with two pages - an initial page containing the splash screen and a second page that will contain the app (right now, they are just two different images to represent the two pages).

I think I have an ordering problem but it may be more then that.

In the session class, I have an event handler for open -

if not self.SplashDone then DesktopBrowser.Show else DTMainMenu.Show end

I have the desktop page loading and setting a session boolean property SplashScreenDone to true.
I have a timer in the splashs screen (DesktopBrowser page) that fires after 2.5 seconds, that timers action is to basically reload the web page.
On doing this, it still loads the DesktopBrowser page instead of the DTMainMenu page.

I’m sure I have an order of operation issue going on here and/or a session issue. This is all being done within the debugger. I didn’t notice any info in the docs that I had to “save” the session data manually. Any tips on what I might need to look at to do differently would be appreciated!

I think I may have seen part of my problem, but I’m not sure, I thought the websessions worked similarly to PHP sessions in that it saved the data, but maybe I’m wrong?

You have to think the other way around and in terms of events chaining.

Normally in your project, you set the App.DefaultWebPage, so if you set it to your Splash Screen Page then you have nothing to do in your Session.Open event, the Splash Screen Page will appear first to the visitor.

Then, in your Splash Screen Page ‘Shown’ event, you trigger the timer that you have embedded (and set to Off) into this Splash Screen Page (Timer.mode = Single). In the Action event of this timer, simply set; Session.CurrentPage = YourMainPage and you are set.


Thank you, I had actually just figured that out a second ago rofl, not quite as cleanly as what you suggested though so I’ll have to go back and straighten that up. I am concerned about its functionality though going forward as ultimately a CGI based web app instead of a constantly running web app.

What concerns?

My concerns are probably unfounded, I’m just not sure how the small client app interacts when it sends messages back to the server for processing, plus I’m trying to figure out how to handle when larger images are involved to improve performance (the splash screen I have shifting to the regular background looks kinda ugly in the transition and I know it’s due to the need to download the image).