Re: Gtk3::Image and GtkIconSize



On 21.12.2012 12:03, Mario Kemper wrote:
When I change it to...
my $image = Gtk3::Image->new_from_stock( 'gtk-index', 'menu' );

... the following error occurs:
Argument "menu" isn't numeric in subroutine entry at
/usr/lib/perl5/Glib/Object/Introspection.pm line 57, <DATA> line 19.

Does the matching between the numeric values and the corresponding
strings not work yet? Passing '1' does work as expected.

Unfortunately, that seems to be intentional. Looking at <http://developer.gnome.org/gtk3/stable/GtkImage.html#gtk-image-new-from-stock>, the "size" parameter has a "[type int]" annotation. The Perl bindings thus see a plain integer parameter, and the enum string magic is never invoked. The reason for this annotation is explained in <https://bugzilla.gnome.org/show_bug.cgi?id=604895>.

I haven't figured out how to deal with this. Suggestions welcome. Maybe some facility in Glib::Object::Introspection that lets binding authors mark certain parameters as being "extendable enums", for which enum strings and integers are accepted.



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