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



On Mon, Jun 11, 2012 at 7:11 PM, Dave M <dave nerd gmail com> 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.

On to the actual meat. ÂIn general: looking good already! ÂSome comments:

â 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.

â The code

Âif( ! $user_data ) {
 Â$action->signal_connect( 'activate', $callback );
Â} else {
 Â$action->signal_connect( 'activate', $callback, $user_data );
Â}

should simply be

Â$action->signal_connect( 'activate', $callback, $user_data );

Even if the user data evaluates to false, it should still be passed to the
callback. Â(And signal_connect handles undef for the user data just fine.)
Fixed.

â Good idea to use add_action_with_accel to save code!

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

â 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. :)

â 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.


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

Also, and semi-offtopic, I have begun creating updated versions of
gtk2-demo examples here:
https://github.com/dave-theunsub/gtk3-perl-demos.git
All the good usernames were taken.
Mostly this is for my own practice, but if anyone else wants to play
along or if these can be used in a future Perl gtk3-demo, that's great
too.  These are the ones I've been able to make work... I've been
unable to get some of them to successfully go... still working on them
- pulled out lots of hair trying to make StatusIcon work, for
example...

Thanks,
Dave M

Attachment: add_actions2.tar.gz
Description: GNU Zip compressed data



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