In trying to add wxTextCtrl to wxruby-swig, I''ve been running into a
problem with the argument conversion that appears to be a SWIG director
bug. It is tied to multiple inheritance, and is related to SWIG
specifically making director''s ''initialize'' take a
first argument, but
because ''initialize'' is static there isn''t a self
value there, shifting
all arguments over one. One way to demonstrate this is with the
following sample:
require ''wx''
#begin sample
include Wx;
class TestFrame < Frame
def initialize()
super(nil,-1,"Test",Point.new(100,100),Size.new(100,100))
@win = Window.new(self,-1,Point.new(0,0),Size.new(100,100))
end
end
class TestApp < App
def on_init()
TestFrame.new().show(true)
end
end
TestApp.new().main_loop()
#end sample
On my build, Window won''t create complaining that there isn''t
a matching
constructor. However, if you add to the Window.i file:
%ignore wxWindow::wxWindow()
The sample creates itself. Note I am still using SWIG-1.3.21 (not the
CVS HEAD).
I haven''t completed my investigation, but I think this is a SWIG/Ruby
bug in how directors handle multiple inheritance of initialize.
Nick
Ok...I''m taking Kevin up on what he told me... "Adding widgets to wxruby-swig usually does not require any c++ knowlege, so if you could play around with it, and get your sample apps working with it, that would be a big help I think having a solid understanding of ruby will definitely help you learn c++." - Kevin And since I dont'' have Visual Studio I have downloaded cygwin and am attempting to get everything to install . I''m also attempting to get it to install with distcc over multiple cygwin environments and several different machines, because I hate waiting for wxWindows to compile....(I am trying to do everything from source) So I have taking a break on my AppSizer (although I changed implementation and it can now be used like ParagraphLayout in java, but is a little more robust) in order to see if I can add it straight to the wxruby-swig effort. So my plans for aiding wxRuby.....in the next near future. 1- Compile with cygwin, update the installation tutorial 2 - Compile with distcc over multiple cygwin environments, update the installation tutorial 3 - Translate my AppSizer to wxruby-swig (I will probably ask for help here...;) Zach
Where do I get the source for the swig version of wxruby, is 0.5.0 wxruby-swig? Thanks Zach
Currently it''s only in CVS, though we''re working to get it to where wxruby was at 0.1 (good set of widgets, no crashy-crashy). It is in the same repository, but it is the wxruby-swig project. Actually, if I could help you through getting the build process up, it would go a long way in documenting what the build process *is*. There are a few things you need first: 1) Rake (rake.rubyforge.org) 2) SWIG (www.swig.org - get 1.3.21 or CVS HEAD) 3) nqxml (http://nqxml.sourceforge.net/) A few notes: 1) I know for a fact that rake does not work under the MinGW MSYS environment. I haven''t looked into the why yet. I haven''t tried with cygwin yet. 2) There is talk of moving from nqxml to rexml (which ships with Ruby 1.8) Please post any questions you have with building to the mailing list. Hopefully, your experience will help get a wiki page about it up. :-) Nick Zach Dennis wrote:> Where do I get the source for the swig version of wxruby, is 0.5.0 > wxruby-swig? Thanks > > Zach > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > . >