[fxruby-users] Question about events and addInput

Dave McDonald drmcdona at verizon.net
Thu Oct 26 14:21:19 EDT 2006

I am very new to FXruby so this may be a simple question (I hope). I have a
ruby script I wrote to do system maintenance (backup, clean files, etc) on
Windows. I wanted to add a small popup FXruby window to show what was
happening and perhaps warn before rebooting, etc.
 Q1: I hit on the idea of having my main script start the FXruby program as
a  separate process and use stdout/stdin to tell the window what  text to
display  - is this  a reasonable approach?
Q2: When I add the addInput code (below) I can run the FXruby window program
from a command prompt and type in text and it updates; however, the window
also displays the hourglass icon when the mouse pointer is over it and it
blocks using the window cancel button (upper right X) to close it. Am I
doing something wrong in my code that blocks the "close" event and causes
the hourglass?

def onInputData( sender, sel, ptr)
    @msg.text = $stdin.gets

@app.addInput($stdin, INPUT_READ, method(:onInputData))


Dave McDonald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20061026/221f874a/attachment.html 

More information about the fxruby-users mailing list