Re: Hm. ItemFactory vs. gtk2-perl 0.90 ? :)



Ross McFarland wrote:

... proposed change to the behavior of Gtk2::ItemFactory->create_item
 under the hash input type:

[ code snipped ]

reason i post this is two fold. 1) desire for a consensus on whether
or not this is the best manner/behavior. 2) for you perl magicians
out there to suggest a better way of doing this. ...

Ok, I'm a sucker for this kind of thing.  So what.

Yeah, me too. :)  Here's another way to go about it...

my @keys = qw(path accelerator callback action type extra);
my $pat = join("|", @keys);

foreach (grep (!/^($pat)$/o, keys %$entry))
{
  # print error about incorrect parameter in $_
}

($path, $accelerator, $callback, $action, $type, $extra) = @$entry{ keys};

Brett.




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