RCairo: warning: instance variable surface not initialized

S

Stefan Salewski

I have a Ruby/GTK/Cairo test application:

http://www.ssalewski.de/PetEd-Demo.html.en
http://www.ssalewski.de/peted.rb

Seems to work fine, but

$ ruby -w peted.rb

gives

peted.rb:207: warning: instance variable surface not initialized


205 def paint
206 cr0 = @darea.window.create_cairo_context
207 other = cr0.target
208 cr0.destroy

I am still new to Ruby and Cairo, so I have not really an idea what is
wrong.

I know, for GTK+ 2.22 there is a new
gdk_window_create_similar_surface ()
which will make life easier, but I still have only 2.20 (Gentoo), and
the application should really not require latest GTK.

Best regards,

Stefan Salewski
 
K

Kouhei Sutou

Hi,

Sorry for my late response...

2010/12/24 Stefan Salewski said:
I have a Ruby/GTK/Cairo test application:

http://www.ssalewski.de/PetEd-Demo.html.en
http://www.ssalewski.de/peted.rb

Seems to work fine, but

$ ruby -w peted.rb

gives

peted.rb:207: warning: instance variable surface not initialized


205 =A0def paint
206 =A0 =A0cr0 =3D @darea.window.create_cairo_context
207 =A0 =A0other =3D cr0.target
208 =A0 =A0cr0.destroy

I am still new to Ruby and Cairo, so I have not really an idea what is
wrong.

It's a problem of rcairo and Ruby/GTK+.
Your application isn't wrong.

I'll fix it. Please wait new releases of those packages.


Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top