[perl-Gtk3] Gtk3::HBox/Gtk3::VBox: use correct defaults in constructors
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk3] Gtk3::HBox/Gtk3::VBox: use correct defaults in constructors
- Date: Sun, 1 Sep 2013 12:24:12 +0000 (UTC)
commit 9c6f0feadd1ae6f8a711f9eeab487fd8cd656bef
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun Sep 1 14:23:50 2013 +0200
Gtk3::HBox/Gtk3::VBox: use correct defaults in constructors
The defaults for 'homogeneous' and 'spacing' were swapped.
Spotted by Thierry Vignaud.
lib/Gtk3.pm | 8 ++++----
t/overrides.t | 11 ++++++++++-
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/lib/Gtk3.pm b/lib/Gtk3.pm
index 3e9cde2..ea71724 100644
--- a/lib/Gtk3.pm
+++ b/lib/Gtk3.pm
@@ -779,8 +779,8 @@ sub Gtk3::FileChooserDialog::new {
sub Gtk3::HBox::new {
my ($class, $homogeneous, $spacing) = @_;
- $homogeneous = 5 unless defined $homogeneous;
- $spacing = 0 unless defined $spacing;
+ $homogeneous = 0 unless defined $homogeneous;
+ $spacing = 5 unless defined $spacing;
return Glib::Object::Introspection->invoke (
$_GTK_BASENAME, 'HBox', 'new', $class, $homogeneous, $spacing);
}
@@ -1173,8 +1173,8 @@ sub Gtk3::UIManager::add_ui_from_string {
sub Gtk3::VBox::new {
my ($class, $homogeneous, $spacing) = @_;
- $homogeneous = 5 unless defined $homogeneous;
- $spacing = 0 unless defined $spacing;
+ $homogeneous = 0 unless defined $homogeneous;
+ $spacing = 5 unless defined $spacing;
return Glib::Object::Introspection->invoke (
$_GTK_BASENAME, 'VBox', 'new', $class, $homogeneous, $spacing);
}
diff --git a/t/overrides.t b/t/overrides.t
index e33eef2..02127b8 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -7,7 +7,7 @@ use warnings;
use utf8;
use Encode;
-plan tests => 155;
+plan tests => 159;
# Gtk3::CHECK_VERSION and check_version
{
@@ -46,6 +46,15 @@ plan tests => 155;
ok (1);
}
+# Gtk3::[HV]Box
+{
+ foreach my $class (qw/HBox VBox/) {
+ my $box = "Gtk3::$class"->new;
+ ok (!$box->get_homogeneous);
+ is ($box->get_spacing, 5);
+ }
+}
+
# Gtk3::Button::new
{
my $button = Gtk3::Button->new;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]