Re: Gtk3::Image and GtkIconSize

Dave M <dave nerd gmail com> writes:

Here's a first run at Gtk3::Image.

Sorry for the long delay.  Comments on the patch:

1. I did a hash lookup for the icon/size stuff, as was originally done

Did the approach using Glib::Object::Introspection->convert_enum_to_sv
and Glib::Object::Introspection->convert_sv_to_enum as outlined in
not work?  It would avoid hard-coding the enum values and would thus be
preferable.  It would also handle custom icon sizes registered with

From the patch:

+  foreach my $ctor (qw/get_icon_set get_stock get_icon_name/) {
+ foreach my $ctor (qw/set_from_stock set_from_icon_set set_from_icon_name/) {

These loops iterate over getters and setters, not ctors (constructors),
so the loop variable's name is misleading.  Also, the setters don't
return anything, so the 'return' statement is also misleading here.

2. I don't know what a gicon is, so I didn't do those (yet?).

That's coming from gio.  I'm contemplating making Gtk3 depend on
Glib::IO, which would make this API usable.  Ignore for now.

3. Some of the tests in GtkImage.t were for things apparently no
longer supported, so I removed those.   It's also down to 32 tests
now, but everything seems covered (except for the gicon stuff) and
passes.  Finally, I did some minor formatting with it.

Looks good.

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