Kirix Support Forums

Porting to Ruby with WxRuby/Stack level too deep error

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

Porting to Ruby with WxRuby/Stack level too deep error

Postby daniel syddall on Tue Jan 12, 2010 1:30 am

I'm trying to port the wxWebControl control to Ruby, using the WxRuby 2 wrappers. I've managed to get part way there, but I'm having some issues that maybe someone could help out with.

I've managed to compile the wxWebControl into the WxRuby 2 library, and I can successfully initialize the XulRunner engine, but when I try to instantiate the wxWebControl, I am getting a stack level too deep error.

Here's my Ruby app code:

Code: Select all
class WebControlFrame < Wx::Frame
  def initialize(*args)
    super(nil, *args)
    puts "INIT: " + Wx::WebControl.init_engine("/usr/lib/xulrunner-1.9.1/").to_s
    panel =
    puts "NEW: " + (@web_control =, -1,, 0),, 600))).inspect
    sizer =;
    sizer.add(@web_control, 1, Wx::EXPAND);
    panel.sizer = sizer
    puts "OPEN_URI: " + @web_control.open_uri("").to_s;
    puts "END_INIT."
  def on_init
  def on_size

class WebControlApp < Wx::App
  def on_init
    frame = :title => "WebControl demonstration",
                                 :pos => [ 50, 50 ],
                                 :size => [ 1024, 768 ] )

and here's what I get when I try to run it:

Code: Select all
$ env LD_LIBRARY_PATH=../../webconnect/webconnect/webconnect irb
irb(main):001:0> require 'samples/webconnect/web_control.rb'
Calling wxEntry, this=0xa433d00
Registering ';1' (
Registering ';1?what=python' (
INIT: true
NEW: #<Wx::WebControl:0xb56943e8>
SystemStackError: stack level too deep
        from ./samples/webconnect/web_control.rb:26:in `is_shown'
        from ./samples/webconnect/web_control.rb:26:in `calc_min'
        from ./samples/webconnect/web_control.rb:26:in `layout'
        from ./samples/webconnect/web_control.rb:26:in `process_event'
        from ./samples/webconnect/web_control.rb:26:in `show'
        from ./samples/webconnect/web_control.rb:26:in `on_init'
        from ./samples/webconnect/web_control.rb:30:in `main_loop'
        from ./samples/webconnect/web_control.rb:30
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from (irb):1

The stack error occurs after the WxFrame has initialized, i.e. it seems to be occurring while the frame is determining its layout, perhaps.

I'd be very grateful if you could provide any information on what might be causing this.

daniel syddall
Registered User
Posts: 1
Joined: Tue Jan 12, 2010 1:10 am

Return to wxWebConnect Questions, Thoughts & Feedback