[wxruby-users] Wx::Font.new fails in a Runtime Error
Кирилл Лиходедов
kirill.likhodedov at gmail.com
Mon Oct 13 09:36:35 EDT 2008
Oops, sorry, that should be text.set_default_style(Wx::TextAttr.new(Wx::BLACK,
Wx::WHITE, font))
OK, I understand, it works now, thanks for the hint!
But the main problem still exists: it is very hard to determine when you use
wrong or incomplete method signature, when it just silently fails.Is it some
configuration problem of mine or it is WxRuby feature?
2008/10/13 Кирилл Лиходедов <kirill.likhodedov at gmail.com>
>
> 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/9e1c4320/attachment.html>
More information about the wxruby-users
mailing list