i am stuck with a weird error with gnomecanvas please see the example
below (I know it’s deprecated, but goocanvas binding is missing
methods).
The code is working well with ruby 1.8 but in ruby 1.9 i got the error:
test.rb:18:in set_property': wrong argument type Array (expected Struct) (TypeError) from test.rb:18:ininitialize’
from test.rb:18:in new' from test.rb:18:in’
I understand about needing gnomecanvas. I won’t be able to be able to
use goocanvas for some time.
I’ll see if I can help out here. Which version of the bindings are you
using.
I’m running
Ruby 1.9.2p320
Gtk::BINDING_VERSION [1, 1, 3]
Gtk::VERSION [2, 10, 4]
I build my own Ruby build W/ Ruby/Gnome bindings. Since gnomecanvas, and
a few others are not in the most recent release’s, I just grab them out
of the last build that had them, 0.95.
I have a build script like this
set gnomeTarget = ruby-gnome2-all-1.1.3
rm -rf $gnomeTarget
tar xf $gnomeTarget.tar.gz
rm -rf ruby-gnome2-all-0.90.5
tar xf ruby-gnome2-all-0.90.5.tar.gz
#add some old gnome modules in
cp -rp ruby-gnome2-all-0.90.5/libart $gnomeTarget
cp -rp ruby-gnome2-all-0.90.5/gnomecanvas $gnomeTarget
cp -rp ruby-gnome2-all-0.90.5/gnome $gnomeTarget
cd $gnomeTarget
$instDir/bin/ruby extconf.rb
make install
Ok, I got off topic here. So I am basically using ruby-gnome2 1.13, with
the gnomecanvas from 0.95.
Get the bindings version you are using. Try running
Sorry, I forgot to mention, under my setup, your example is working fine
on Ruby 1.9.2. If you really need to support older gnomecanvas and
stuff. I highly recommend not relying on the OS default built in
ruby(/usr/bin/ruby)
Building your own ruby build is the way to go. Actually, I’d never
recommend using an OS’s own distribution of Ruby… but that is just me.
I hate to rely on the OS or distributor to keep up with things when I
can help it.