[Fxruby-commits] CVS: FXRuby/examples inputs.rb,1.4,1.4.2.1
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@us...> - 2002-06-11 14:42:31
|
Update of /cvsroot/fxruby/FXRuby/examples In directory usw-pr-cvs1:/tmp/cvs-serv5940 Modified Files: Tag: release10 inputs.rb Log Message: Fixed a bug in the inputs.rb example program; we should go ahead and close the pipe when it starts returning nil reads so that it doesn't flood the text buffer. Index: inputs.rb =================================================================== RCS file: /cvsroot/fxruby/FXRuby/examples/inputs.rb,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** inputs.rb 27 Nov 2001 15:46:10 -0000 1.4 --- inputs.rb 11 Jun 2002 14:42:28 -0000 1.4.2.1 *************** *** 34,40 **** end def onCmdText(sender, sel, ptr) ! # Remove previous input (if any) ! getApp().removeInput(@pipe, INPUT_READ|INPUT_EXCEPT) if @pipe # Clean up the output window --- 34,48 ---- end + # Remove previous input (if any) + def closePipe + if @pipe + getApp().removeInput(@pipe, INPUT_READ|INPUT_EXCEPT) + @pipe = nil + end + end + def onCmdText(sender, sel, ptr) ! # Stop previous command ! closePipe # Clean up the output window *************** *** 48,52 **** case SELTYPE(sel) when SEL_IO_READ ! @cmdOutput.appendText(@pipe.read) when SEL_IO_EXCEPT puts 'onPipeExcept' --- 56,65 ---- case SELTYPE(sel) when SEL_IO_READ ! text = @pipe.read ! if text ! @cmdOutput.appendText(text) ! else ! closePipe ! end when SEL_IO_EXCEPT puts 'onPipeExcept' |