[fxruby-users] How can I make a window stay open for a set amount of time?

Paul Carvalho tester.paul at gmail.com
Thu May 31 16:34:17 EDT 2007

Hi there, I have this script that I want to go away after a few minutes.
I'm new to FxRuby and don't know how to use the addTimeout() method though.

Can someone please help me with this sample 'hello world' script below?

require 'fox14'
include Fox

application = FXApp.new("Hello", "FoxTest")
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT)

          delay = 5 * 1000     # (time is in milliseconds)
          application.addTimeout( delay, exit )


I want the window to display for 5 seconds and disappear.  When I run the
above script nothing seems to happen though.  The window never appears.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070531/8a59b017/attachment.html 

More information about the fxruby-users mailing list