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

Кирилл Лиходедов kirill.likhodedov at gmail.com
Mon Oct 13 08:41:17 EDT 2008


I can't construct a Wx::Font object, because it leads to a Runtime Error,
though it seems that I use it as per documentation of WxRuby.

Strangely, many mistakes lead to such an error instead of a verbose Ruby
exception :(

Could you please help me with this?
Thanks a lot in advance.
Please see the sample code below.

====================
require 'wx'

class TestFrame < Wx::Frame
  def initialize()
    super(nil, -1, "CMD")
    Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE)
  end
end

class TestApp < Wx::App
  def on_init
    TestFrame.new().show()
  end
end

TestApp.new.main_loop
====================

Enviroment:
Windows XP SP-2
Ruby 1.8.6
WxRuby 1.9.8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081013/3f827db7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.png
Type: image/png
Size: 8836 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081013/3f827db7/attachment-0001.png>


More information about the wxruby-users mailing list