Re: Gtk3::Image and GtkIconSize

On Fri, Feb 15, 2013 at 9:06 AM, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
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

Yes, I had tried it before, and I got the same problem I'm getting now
with it.  When I run the the GtkImage.t file, there are error messages
like these:
not ok 20 - set_from_icon_set get_icon_set size
#   Failed test 'set_from_icon_set get_icon_set size'
#   at GtkImage.t line 98.
#          got: '0'
#     expected: 'small-toolbar'
not ok 31
#   Failed test at GtkImage.t line 152.
#     Structures begin differing at:
#          $got->[1] = '0'
#     $expected->[1] = 'menu'

Are there default values that are supposed to be set but aren't?  For
example, the first time this comes up is test #2.  I Data::Dumper-ed
the values to be compared to see what was going on:
print Dumper [ $img->get_icon_set ];
print Dumper [ undef, 'button' ];
ok (eq_array ([$img->get_icon_set], [undef, 'button']), 'get_icon_set empty');
$VAR1 = [
$VAR1 = [
not ok 2 - get_icon_set empty
#   Failed test 'get_icon_set empty'
#   at GtkImage.t line 54.
This happens after creating a plain Gtk3::Image with no other values.
Do we need to add some override information in the new* constructors
to use a default size of 'button' if nothing else is given?

Dave M

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