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? :)
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? :)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
Maybe Matching Threads
- Wx:Wizard, Wx::WizardPageSimple
- [1043] trunk/wxruby2/samples/bigdemo: Don''t manually call destroy
- SplashScreen
- isolynux + splashscreen
- [679] trunk/wxruby2/doc/textile/previewframe.txtl: Changed the initialize() method to init() so it matches the API also added a remark alerting the user to this.