[fxruby-users] How can I make a window stay open for a set amount of time?
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?
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...
More information about the fxruby-users