Guillaume Bestguigui wrote:> I need to create a WxRuby application that still runs when the frame is
> inactive. The application must display a message when something happens,
> even if the application is not focused. How could I do that ?
The most conventional way would probably be to call Wx::App#is_active
(or Wx::App#active?) to see if the application is in the foreground. If
it isn''t, call Wx::TopLevelWindow#request_user_attention when you want
the user to switch to a given frame. This will use the platform''s
correct way of signalling that an update has happened in the app - eg,
on Windows, I think it will make the application''s icon/title in the
taskbar flash.
Note that you can also detect when an app becomes active/inactive using
the event handlers provided by ActivateEvent. See the sample
etc/activation.rb for an example of this.
http://wxruby.rubyforge.org/doc/app.html#App_isactive
http://wxruby.rubyforge.org/doc/toplevelwindow.html#TopLevelWindow_requestuserattention
http://wxruby.rubyforge.org/doc/activateevent.html
As an alternative, you could use Wx::TaskBarIcon to have an icon for the
app in the area near the clock (on Windows). You could change the
icon''s
appearance when information is available.
a