Ruby wxRuby GUI XRC to rb error

153 Views Asked by At
Cannot create wrapper for class without 'subclass'
      attribute

It outputs as blank file. My command is

xrcise -o Button.rb Button.xrc

I use DialogBlock designer.

1

There are 1 best solutions below

0
On

What you need is to set a "subclass name" field related to the form somewhere in DialogBlog project. Without that subclass name xrcise can't convert your .xrc to .rb file. Another problem that you should be aware of is that current version of xrcise which is part of wx_sugar-0.1.22 (this is last version for now) can't work with ruby version 1.9.3 or higher becouse some sintax error with method .each that was changed in this vershion. To solve this problem the best way is add this:

class String 
alias :each :each_line
end

right after require statements inside the file xrcise. Hope it would be helpfull.

P.S. Sorry for my pure english, currently working on it.