List Info

Thread: Wx::SplashScreen, and events




Wx::SplashScreen, and events
country flaguser name
United States
2007-12-27 01:18:43
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? 
_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

Re: Wx::SplashScreen, and events
country flaguser name
United Kingdom
2007-12-27 08:22:40
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


_______________________________________________
wxruby-users mailing list
wxruby-usersrubyforge.org
ht
tp://rubyforge.org/mailman/listinfo/wxruby-users

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )