Re: Can't locate object method "add_actions"...



On 22.06.2012 15:35, Dave M wrote:
• Please adapt to the style of the surrounding code.  In this case this
means indentation with two spaces (not tabs) and slightly different spacing
around parens.
I think this has all been corrected now.

Yep, mostly. I still see some stray tabs, though. They jump out if your tab width is different from 4. s/\t/ /g should do the trick.

• The XS code allowed the entries to be either array or hash references.  It
would be nice to preserve this.
While this version does check that $entries is an arrayref, it does
treat its entries as an array or hash.  Is that what was meant?  The
uimanager.pl example (included) adds an array of hashes example which
works.

Yep, looks fine.

• Gtk3::ActionGroup::add_actions doesn't seem to translate the label and the
tooltip.
Fixed.

OK. But the translate_string calls are now done only if the strings evaluate to true. I think it is better to check only whether they are defined.

• Ah, now I see what you meant by "hyper mode" above.  The problem is that
you connect to $first_action's changed signal anew each time the loop is
run.  The code block should be moved outside the loop.
Fixed. My vision must be failing. :)

OK.  Relatedly, in your new $process anon-subs, you have:

    my (@properties) = @_;
    my ($name, $stock_id, $label, $accelerator, $tooltip, $callback);
    for my $p (@properties) {
    ...

This is confusing because they are only passed one entry at a time. Better use

    my ($p) = @_;
    my ($name, $stock_id, $label, $accelerator, $tooltip, $callback);
    ...

• The example program is very good to have, but it would also be good to
have unit tests for the three overrides.
I updated the original test, but not by much.  I didn't see the point
in changing anything because the specs don't seem to differ from 2 ->
3. Again, I have limited experience in writing tests, so I might need
some help with that.

The test looks fine.

I've included a diff, an updated test file, and the uimanager.pl as
well.  I'm open to additional feedback.

One final request: please put your additions to Gtk3.pm into their correct position according to the sorting used. That is, the 'Gtk3::ActionGroup::list_actions' should move to the top of @_GTK_FLATTEN_ARRAY_REF_RETURN_FOR, and the subs should move above the sub Gtk3::Builder::add_objects_from_file.

Also, and semi-offtopic, I have begun creating updated versions of
gtk2-demo examples here:
https://github.com/dave-theunsub/gtk3-perl-demos.git

Great!  Once you feel happy with the code, we can also merge this into Gtk3.



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