Commit 23e9ecd0 authored by dobbyth33lf's avatar dobbyth33lf Committed by Torsten Schönfeld

Add override for Gtk3::TargetEntry

https://bugzilla.gnome.org/show_bug.cgi?id=795780
parent bef74db6
......@@ -1577,6 +1577,21 @@ sub Gtk3::StyleContext::get {
return @values[0..$#values];
}
=item * An override for C<Gtk3::TargetEntry::new> is provided that
automatically handles the conversion of the C<flags> argument.
=cut
sub Gtk3::TargetEntry::new {
my ($class, $target, $flags, $info) = @_;
if ($flags !~ /^\d+$/) {
$flags = Glib::Object::Introspection->convert_sv_to_flags (
"Gtk3::TargetFlags", $flags)
}
return Glib::Object::Introspection->invoke (
$_GTK_BASENAME, 'TargetEntry', 'new', $class, $target, $flags, $info);
}
=item * A Perl reimplementation of C<Gtk3::TextBuffer::create_tag> is provided.
=cut
......
......@@ -7,7 +7,7 @@ use warnings;
use utf8;
use Encode;
plan tests => 230;
plan tests => 233;
note('Gtk3::CHECK_VERSION and check_version');
{
......@@ -328,6 +328,30 @@ note('Gtk3::StyleContext::get');
is (scalar @v, 2, 'two items returned');
}
note('Gtk3::TargetEntry');
{
my $output;
open local *STDERR, '>', \$output;
my $target_entry = Gtk3::TargetEntry->new(
'Glib::Scalar',
Glib::Object::Introspection->convert_sv_to_flags (
"Gtk3::TargetFlags", qw/same-widget/),
0);
is($output, undef, 'convert_sv_to_flags');
$target_entry = Gtk3::TargetEntry->new(
'Glib::Scalar',
${Gtk3::TargetFlags->new (qw/same-widget/)},
0);
is($output, undef, 'Gtk3::TargetFlags->new');
$target_entry = Gtk3::TargetEntry->new(
'Glib::Scalar',
qw/same-widget/,
0);
is($output, undef, 'override');
}
note('Gtk3::ToggleButton::new');
{
my $button = Gtk3::ToggleButton->new;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment