Re: menuitem confusion
- From: Dave M <dave nerd gmail com>
- To: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Re: menuitem confusion
- Date: Tue, 3 Jul 2012 18:15:26 -0500
On Tue, Jul 3, 2012 at 1:29 PM, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
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.
You're right; your way is much better. I thought because the code was
minimal and contained custom error messages that it would work out.
I'll work on a diff for it and resend.
Thanks,
Dave M
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]