Wx::SplashScreen, and events

I have the following code:
#time = 7000

class TimeSplash < Wx::SplashScreen
PATH_MAIN = 1
PATH_SETUP = 0
def initialize(time, path=PATH_MAIN)
splash_bitmap = Wx::Bitmap.new(‘timefly.png’, Wx::BITMAP_TYPE_PNG)
super(splash_bitmap,
Wx::SPLASH_CENTRE_ON_SCREEN|Wx::SPLASH_TIMEOUT, time, nil, -1)
evt_close() {|evt| on_close_window(evt, path)}
end

def on_close_window(evt, path)
if path == PATH_MAIN
print “main app!”
elsif path == PATH_SETUP
print “setup!”
end
self.destroy()
end
end

Now I’m stuck - If I click the splash screen while it is being displayed
it calls the evt_close() event and prints a message. However - if I wait
for it to timeout - it fades away and then nothing happens. What event
is triggered at the timeout? How can I trap it? Where are these events
documented? :slight_smile:

EchoB wrote:

Now I’m stuck - If I click the splash screen while it is being displayed
it calls the evt_close() event and prints a message. However - if I wait
for it to timeout - it fades away and then nothing happens. What event
is triggered at the timeout? How can I trap it?
I don’t know how you can. But I don’t know why you would?

Code execution continues after the call to SplashScreen.new, allowing
you to do time-consuming initialisation while the splash is visible and
entertaining the user. Once the initialisation is done you can let the
Splash timeout, let the user close it, or explicitly close it yourself
using a standard close call.

Where are these events
documented? :slight_smile:
In a slightly scattered way: per-control event hooks (eg TreeEvent,
CommandEvent, GridEvent) are listed with the control; non-command GUI
event hooks (eg MenuEvent, SizeEvent, CloseEvent) are listed in the
event class. The comprehensive list is very long (see
lib/wx/classes/evthandler.rb for a full alphabetic list), but hte list
of Event classes in the doc homepage is not a bad place to start.

alex