[perl-Gtk2-SourceView2] Fix a glib warning when a SourceView2::View is not added to a parent widget and destroyed
- From: Emmanuel Rodriguez <erodriguez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2-SourceView2] Fix a glib warning when a SourceView2::View is not added to a parent widget and destroyed
- Date: Sun, 30 May 2010 21:47:01 +0000 (UTC)
commit fc9a369f4dfd9e890144ade03dc67e03d0bb146d
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date: Sun May 30 23:25:56 2010 +0200
Fix a glib warning when a SourceView2::View is not added to a parent widget and destroyed
t/GtkSourcePrintCompositor.t | 8 +++++---
t/GtkSourceView.t | 5 +++++
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/t/GtkSourcePrintCompositor.t b/t/GtkSourcePrintCompositor.t
index 34ebd80..110ce31 100644
--- a/t/GtkSourcePrintCompositor.t
+++ b/t/GtkSourcePrintCompositor.t
@@ -29,9 +29,11 @@ sub test_constructors {
);
isa_ok($print, 'Gtk2::SourceView2::PrintCompositor');
- $print = Gtk2::SourceView2::PrintCompositor->new_from_view(
- Gtk2::SourceView2::View->new()
- );
+ my $window = Gtk2::Window->new();
+ my $view = Gtk2::SourceView2::View->new();
+ $window->add($view);
+
+ $print = Gtk2::SourceView2::PrintCompositor->new_from_view($view);
isa_ok($print, 'Gtk2::SourceView2::PrintCompositor');
}
diff --git a/t/GtkSourceView.t b/t/GtkSourceView.t
index 6b07a92..9addef3 100644
--- a/t/GtkSourceView.t
+++ b/t/GtkSourceView.t
@@ -24,17 +24,22 @@ sub tests {
sub test_constructors {
+ my $parent = Gtk2::HBox->new();
my $view = Gtk2::SourceView2::View->new();
+ $parent->add($view);
isa_ok($view, 'Gtk2::SourceView2::View');
my $buffer = Gtk2::SourceView2::Buffer->new(undef);
$view = Gtk2::SourceView2::View->new_with_buffer($buffer);
+ $parent->add($view);
isa_ok($view, 'Gtk2::SourceView2::View');
}
sub test_properties {
+ my $parent = Gtk2::HBox->new();
my $view = Gtk2::SourceView2::View->new();
+ $parent->add($view);
is_int_ok($view, 'tab_width', 4, 6);
is_int_ok($view, 'indent_width', 4, 6);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]