Re: Missing object method: new_from_file_at_size

On 20.10.2014 13:56, Daniel Kasak wrote:
*** unhandled exception in callback:
***   Can't locate object method "new_from_file_at_size" via package
"Gtk3::Gdk::Pixbuf" at window/ <> line 84.
***  ignoring at C:/strawberry/perl/site/lib/ line 318.

Weird.  As you say, it works fine on Linux:

# perl -MGtk3=-init -E'say Gtk3::Gdk::Pixbuf->new_from_file_at_size
("/usr/share/icons/Humanity/actions/24/gtk-ok.svg", 24, 24)'

Do you still have the GdkPixbuf-2.0.gir from which GdkPixbuf-2.0.typelib
was generated?  It should contain an entry akin to this:

      <constructor name="new_from_file_at_size"
        <doc xml:space="preserve">...</doc>
        <return-value transfer-ownership="full">
          <doc xml:space="preserve">...</doc>
          <type name="Pixbuf" c:type="GdkPixbuf*"/>
          <parameter name="filename" transfer-ownership="none">
            <doc xml:space="preserve">Name of file to load, in the GLib
file name encoding</doc>
            <type name="utf8" c:type="const char*"/>
          <parameter name="width" transfer-ownership="none">
            <doc xml:space="preserve">The width the image should have or
-1 to not constrain the width</doc>
            <type name="gint" c:type="int"/>
          <parameter name="height" transfer-ownership="none">
            <doc xml:space="preserve">The height the image should have
or -1 to not constrain the height</doc>
            <type name="gint" c:type="int"/>

To work around the missing binding, try to use new_from_file_at_scale()
or simply new_from_file() and scale_simple().

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]