[fxruby-users] does anyone know how to get fxtext clear correctly between styled writes?

Lyle Johnson lyle at lylejohnson.name
Sun Apr 20 20:36:36 EDT 2008

On Apr 20, 2008, at 6:38 PM, datatec wrote:

> Interesting.
> I was able to try this proof of issue application on ubuntu 7.10
> and although it reproduces the issue 100% of the time on windows xp,
> it does not happen on linux. (as far as I know I am using same  
> version of
> ruby and fxruby)
> Does this mean it is a windows port bug?

In the current release of FXRuby, when you type:

	h = FXHiliteStyle.new

it calls the default constructor the the C++ struct:

	FXHiliteStyle *h = new FXHiliteStyle();

Now, that struct doesn't actually have a constructor defined, and so  
it's possible that some compilers will (be default) initialize h- 
 >style to zero while other compilers will leave that data in an  
undefined state. What I will probably do to fix it is just add some  
code that explicitly initializes the struct's values, so that we won't  
be subject to the whims of a particular C++ compiler.

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

More information about the fxruby-users mailing list