[wxruby-users] Wx::Font.new fails in a Runtime Error

Кирилл Лиходедов kirill.likhodedov at gmail.com
Mon Oct 13 09:31:56 EDT 2008


That worked (but why? Aren't there default values for the rest of the
parameters?), but setting this font as the default style of TextCtrl leads
to the same error:
    text = Wx::TextCtrl.new(self, -1, "text", :style =>
Wx::TE_RICH|Wx::TE_RICH2|Wx::TE_PROCESS_ENTER|Wx::TE_PROCESS_TAB)
    font = Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL,
Wx::FONTWEIGHT_NORMAL)
    text.set_default_style(Wx::TextAttr.new(font))    #This leads to error

By the way, why is it a Runtime threatening error, not an exception?

2008/10/13 Andreas Garnæs <lists at ruby-forum.com>

> Кирилл Лиходедов wrote:
> >     Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE)
>
> Try replacing that line with:
>
> Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL,
> Wx::FONTWEIGHT_NORMAL)
>
> - andreas
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081013/ccc60947/attachment.html>


More information about the wxruby-users mailing list