Re: Gtk3::Image and GtkIconSize



On 21.12.2012 12:24, Torsten Schoenfeld wrote:
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>.

With a recent round of commits to G:O:IÂ, this can now be tackled. I attach an initial patch for the cited constructor. Would you, or anyone else listening, be willing to complete this patch to include support for all or part of the following?

â gtk_image_new_from_stock, gtk_image_new_from_icon_set, gtk_image_new_from_icon_name, [gtk_image_new_from_gicon], gtk_image_set_from_stock, gtk_image_set_from_icon_set, gtk_image_set_from_icon_name, [gtk_image_set_from_gicon], gtk_image_get_stock, gtk_image_get_icon_set, gtk_image_get_icon_name, [gtk_image_get_gicon]
â gtk_icon_size_*
â (gtk_icon_set_render_icon), gtk_icon_set_render_icon_pixbuf, gtk_icon_set_get_sizes
â gtk_icon_source_set_size, gtk_icon_source_get_size

â gtk_action_create_icon
â gtk_scale_button_new
â gtk_tool_item_get_icon_size
â gtk_tool_palette_set_icon_size, gtk_tool_palette_get_icon_size
â gtk_tool_shell_get_icon_size
â gtk_toolbar_get_icon_size, gtk_toolbar_set_icon_size
â gtk_tooltip_set_icon_from_stock, gtk_tooltip_set_icon_from_icon_name, [gtk_tooltip_set_icon_from_gicon]

â (gtk_style_render_icon)
â (gtk_widget_render_icon), gtk_widget_render_icon_pixbuf
â gtk_render_icon_pixbuf

Items in round brackets are deprecated and thus no priority. Items in square brackets might need more work (Glib::IO support) than just the icon size conversion.

 <http://git.gnome.org/browse/perl-Glib-Object-Introspection/commit/?id=9e214e19daa68e72b2bca38f7f09347e25880e13>, <http://git.gnome.org/browse/perl-Glib-Object-Introspection/commit/?id=277a23086a28a1420a90a7100df357d8f008fc35>.

Attachment: icon-size-support-v0.patch
Description: Text Data



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