Re: menuitem confusion



On 03.07.2012 14:04, Dave M wrote:
How is this look? Anything jump out as needing improvement or fixes?

Looking good in general. The code is awfully repetitive, however. Would something like this work?

  {
    no strict qw(refs);
    foreach my $ctor (qw/new new_with_label .../) {
      *{'Gtk3::RadioMenuItem::' . $ctor} = sub {
        my ($class, $group, @rest) = @_;
        $group = [] unless defined $group;
        return Glib::Object::Introspection->invoke (
          $_GTK_BASENAME, 'RadioMenuItem', $ctor,
          $class, $group, @rest);
      }
    }
  }

This would lose the custom usage error messages, but these should be provided automatically by G:O:I (in theory, at least).

Sorry, one more time - left an important line out.  This is a noisier
diff file too, as I diff'ed it against the current stable Gtk3.pm.

That's OK, I can munge it to be of the right form. However, if you have the possibility to work against a git clone, that would make things even easier for me.

  git clone git://git.gnome.org/perl-Gtk3
  cd perl-Gtk3
  git checkout -b radio-menu-item-overrides
  ... hack ...
  git commit -a
  git format-patch HEAD^

But the current patch format works just fine, too.



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