[Foxgui-users]FXRuby: Problem with Text Drawing

You need to call FXDC#end on the image device context to "flush" out the
commands you've sent to it. Add the line:


right after the call to dc.drawText() and before the call to image.render().
The fact that it *happens* to work on Linux without the call to FXDC#end was
just a coincidence that one shouldn't count on :wink:

Also note that FXDC#end will get called when the device context is
garbage-collected by Ruby; but since you don't know when that might happen
(the GC, that is) it's usually best to explicitly call FXDC#end when you're
finished using a DC.

Hope this helps,



On Tue, 10 Sep 2002 13:44:47 +0200, Laurent Julliard <Laurent.Julliard@xrce.xerox.com> wrote :

I have written this little piece of code (see at end of message) which
drwas a piece of text as an image and then display the image. The
result on Linux is a grey text on a green background as expected but
on Windows it simply gives a grey rectangle (see 2 screenshots attached)

I have tried many variants to make it work on Win32 to no avail. Any
idea to help me fix this problem is *really* welcome.