[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wxruby-dev] I want to help
From: |
Kevin Smith |
Subject: |
[Wxruby-dev] I want to help |
Date: |
05 May 2003 21:29:28 -0700 |
Greetings,
I didn't realize that Park Heesob had recently created a working wxRuby,
so last weekend I created my own prototype wxRuby bindings, which you
can find here:
http://qualitycode.com/code/wxRuby-Kevin-0.1.tar.gz
My version includes a small sample based on the Calendar sample that
comes with wxWindows. I have only tested it with Debian (Sarge), and
have not made any attempts to make it easy to compile or run on other
platforms. Don't run extconf.rb, because I have manually modified the
Makefile!
I think Park Heesob's architecture is better than mine, although I'm not
entirely sure yet. So I hope to work with his code, and not to create a
fork or alternative set of bindings.
However, the one really nice feature of my implementation is using a
little Ruby script to automatically generate most of the stub functions
and the rb_define_method calls. It is similar to SWIG, but much simpler
because it is specifically targeted at Ruby and wxWindows.
Any function that is a simple pass-through wrapper can be automated,
which makes it easier to add new methods, avoids duplicated code, and
avoids any potential of a typo causing an incorrect implementation.
Also, with my approach we can exactly inherit the optional parameters
that wxWindows uses.
In my prototype, the Makefile runs wxpp.rb against WXRuby.t to generate
WXRuby.cpp, which is then compiled normally. In WXRuby.t you can see the
//$$ tokens used to generate the wrappers at specific points. test.rb is
the sample calendar app.
So I would like to incrementally shift the existing wxRuby project over
to use a template-based approach like mine. Does this sound acceptable?
I also have a few questions, requests and suggestions about naming and
other conventions.
Thanks,
Kevin
- [Wxruby-dev] I want to help,
Kevin Smith <=