[perl-Gtk2] Gtk2::ComboBox->set_active_iter(): allow undef



commit 3b9f004e9e0856cc513d967cdb72d03bc3414464
Author: Kevin Ryde <user42 zip com au>
Date:   Tue Jun 22 07:36:05 2010 +1000

    Gtk2::ComboBox->set_active_iter(): allow undef
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622323

 t/GtkComboBox.t   |    8 ++++++--
 xs/GtkComboBox.xs |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/t/GtkComboBox.t b/t/GtkComboBox.t
index fcfa4b1..ef19d1e 100644
--- a/t/GtkComboBox.t
+++ b/t/GtkComboBox.t
@@ -3,7 +3,7 @@
 # $Id$
 
 use Gtk2::TestHelper
-	tests => 24,
+	tests => 26,
 	at_least_version => [2, 4, 0, "GtkComboBox is new in 2.4"],
 	;
 
@@ -37,6 +37,10 @@ $combo_box->set_active_iter ($iter);
 is ($model->get_path ($combo_box->get_active_iter)->to_string,
     $model->get_path ($iter)->to_string);
 
+$combo_box->set_active_iter (undef);
+is ($combo_box->get_active, -1);
+is ($combo_box->get_active_iter, undef);
+
 $combo_box = Gtk2::ComboBox->new;
 isa_ok ($combo_box, 'Gtk2::ComboBox');
 # set a model to avoid a nastygram when destroying; some versions of gtk+
@@ -129,7 +133,7 @@ SKIP: {
 
 __END__
 
-Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003-2006, 2010 by the gtk2-perl team (see the file AUTHORS for the
 full list).  See LICENSE for more information.
 
 vim: set ft=perl :
diff --git a/xs/GtkComboBox.xs b/xs/GtkComboBox.xs
index c8ac004..9f0d4d7 100644
--- a/xs/GtkComboBox.xs
+++ b/xs/GtkComboBox.xs
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2006 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003-2006, 2010 by the gtk2-perl team (see the file AUTHORS)
  *
  * Licensed under the LGPL, see LICENSE file for more information.
  *
@@ -121,7 +121,7 @@ gtk_combo_box_get_active_iter (GtkComboBox * combo_box)
     OUTPUT:
 	RETVAL
 
-void gtk_combo_box_set_active_iter (GtkComboBox *combo_box, GtkTreeIter *iter);
+void gtk_combo_box_set_active_iter (GtkComboBox *combo_box, GtkTreeIter_ornull *iter);
 
 ##/* getters and setters */
 



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