[perl-Gtk2] Gtk2::AspectFrame->new(): allows undef for label



commit 67bec02e6ef26ad269823b737d0145ffbeed1cd0
Author: Kevin Ryde <user42 zip com au>
Date:   Sat Oct 16 11:44:09 2010 +1100

    Gtk2::AspectFrame->new(): allows undef for label
    
    https://bugzilla.gnome.org/show_bug.cgi?id=632270

 t/GtkAspectFrame.t   |    8 ++++++--
 xs/GtkAspectFrame.xs |    6 ++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/t/GtkAspectFrame.t b/t/GtkAspectFrame.t
index b1bb117..6d1ace9 100644
--- a/t/GtkAspectFrame.t
+++ b/t/GtkAspectFrame.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 use strict;
-use Gtk2::TestHelper tests => 3, noinit => 1;
+use Gtk2::TestHelper tests => 4, noinit => 1;
 
 # $Id$
 
@@ -15,7 +15,11 @@ $frame -> set_params(1, 1, 6, 1);
 is_deeply([$frame -> get(qw/xalign yalign ratio obey-child/)],
           [1, 1, 6, 1], '$aspect->set_params, verify');
 
+# label can be undef for no label
+$frame = Gtk2::AspectFrame -> new(undef, 1, 1, 3, 0);
+is ($frame->get('label'), undef);
+
 __END__
 
-Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003, 2010 by the gtk2-perl team (see the file AUTHORS for the
 full list).  See LICENSE for more information.
diff --git a/xs/GtkAspectFrame.xs b/xs/GtkAspectFrame.xs
index fc2c133..3114c64 100644
--- a/xs/GtkAspectFrame.xs
+++ b/xs/GtkAspectFrame.xs
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003, 2010 by the gtk2-perl team (see the file AUTHORS)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -24,9 +24,11 @@
 MODULE = Gtk2::AspectFrame	PACKAGE = Gtk2::AspectFrame	PREFIX = gtk_aspect_frame_
 
 ## GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, gfloat yalign, gfloat ratio, gboolean obey_child)
+# label can be NULL for no label, as per gtk_frame_set_label() etc,
+# though not actually in the gtk_aspect_frame_new() docs as of Gtk 2.20
 GtkWidget *
 gtk_aspect_frame_new (class, label, xalign, yalign, ratio, obey_child)
-	const gchar * label
+	const gchar_ornull * label
 	gfloat        xalign
 	gfloat        yalign
 	gfloat        ratio



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