Pixbuf not loading File -- NameError?

Hi:

64bit Ubuntu 10.04

I’m running this code:

x = Gtk::Pixbuf.new “folder_brown.png”

And it says:

uninitialized constant Gtk::Pixbuf (NameError)

I try to catch this error like this:

begin
x = Gtk::Pixbuf.new “folder_brown.png”
rescue NameError => err
puts err.name
puts $!
end

And it says this:

Pixbuf
uninitialized constant Gtk::Pixbuf

So the NameError is in reference to the Name “Pixbuf” not my file?

Aparently, there is an “uninitialized constant” in gtk’s class? Named
Pixbuf? The strange thing is that in Ruby-Gnome’s site they mention
that Nautilus
(file browser that I use) uses the same gtk widgets, so the Pixbuf class
must work because my file browser shows all of its icons.

What gives?

Thanks!

Hi,

2010/10/19 Eric C. [email protected]:

end

And it says this:

Pixbuf
uninitialized constant Gtk::Pixbuf

What gives?

I think you should use Gdk::Pixbuf instead of Gtk::Pixbuf

Refer to http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gdk%3A%3APixbuf

Regards,
Park H.

Thank you Park!!! I never would have noticed that. They look so
similar, and it was even finding the name, ‘pixbuf’ I thought I was
going crazy.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs