[fxruby-users] FXFont bug

William Blum wblum at pacbell.net
Sat Nov 15 07:01:53 EST 2008

It seemed to be impossible to assign a font object to a widget's font 
attribute outside the initialize method. When I did so, Ruby crashed like 

E:\Ruby Programs\Demo>FontBug
E:/Ruby Programs/Demo/FontBug.rb:33: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual 
Please contact the application's support team for more information.

By trial and error I think I have figured out that if you assign a font to a 
widget outside the parent's initialize method, you have to call create on it 

Where is the best documentation that explains under what conditions you must 
call create? Is it a good idea to just call create under all circumstances? 
The FXRuby book says in Chapter 11, "You would first construct the new 
FXFont object, and if necessary, call create() on it." But I can't find when 
"if necessary" is. FXRI does not even mention a create method for FXFont.

Is this a known bug? (I consider it a bug for Ruby to seg fault no matter 
how wrong my code is. And my code is often very, very wrong.)

More information about the fxruby-users mailing list