[fxruby-users] Forcing a re-paint

David Toll toll at us.ibm.com
Thu Oct 30 15:03:14 EDT 2008


Thanks for the suggestion.  Unfortunately, it makes no difference.

However, I think we are looking for the wrong problem.

I can make it effectively make my FXRuby program perform the following, 
repeated 16 times:

    printf("hi\n")     to the FXText window

If I run this then all is well.

However, if I concurrently run two copies of this program, from separate 
DOS-type command windows, then neither of them updates properly until both 
of the programs terminate the above sequence and re-enter command -input 

I.e. it would appear that my problem is that, somehow, multiple FXRuby 
programs, running concurrently on the same copy of Windows, interfere with 
each other. 

I think this requires a deep understanding of how FXRuby works underneath, 
maybe requires an understanding of its interaction with Windows (Windows 
XP in this case). 


On Oct 29, 2008, at 1:40 PM, David Toll wrote:

I have an FXText window which I would like to force to be repainted 
immediately, not wait for the lazy re-paint. 

I have a call to repaint() for the FXText window and for the FXApp.   

The documentation for FXApp.repaint says "Paint all windows marked for 
repainting.  On return all the applications windows have been painted".  I 
take that to mean (or hope that it means) that this a synchronous call, 
and your program should wait for the repaint to complete.  However that 
clearly is not the case - the window gets repainted some considerable time 

This question is addressed in the FAQ:


I think you should be able to call update() on the FXText window (to mark 
it as dirty and in need of a repaint), followed by a call to FXApp#flush 
to immediately flush all drawing commands to the display.

There is no documentation of a repaint method for FXText, nor for its 
parent FXScrollArea.  FXScrollArea's parent is Object, so I am not at all 
sure from which class FXText gets a repaint method.

Actually, FXScrollArea's base class is FXComposite, not FXObject:


Hope this helps,


"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!

fxruby-users mailing list
fxruby-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081030/4fcf749f/attachment.html>

More information about the fxruby-users mailing list