[perl-Gtk2] Accept undef in Gtk2::AccelLabel->set_accel_widget
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Accept undef in Gtk2::AccelLabel->set_accel_widget
- Date: Wed, 31 Mar 2010 16:50:44 +0000 (UTC)
commit c4417f87bfe8ddf4fc68393b093489ad50e28044
Author: Kevin Ryde <user42 zip com au>
Date: Wed Mar 31 18:48:33 2010 +0200
Accept undef in Gtk2::AccelLabel->set_accel_widget
https://bugzilla.gnome.org/show_bug.cgi?id=613353
t/GtkAccelLabel.t | 8 ++++++--
xs/GtkAccelLabel.xs | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/t/GtkAccelLabel.t b/t/GtkAccelLabel.t
index cbcaa66..c82a60d 100644
--- a/t/GtkAccelLabel.t
+++ b/t/GtkAccelLabel.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 4;
+use Gtk2::TestHelper tests => 5;
# $Id$
@@ -9,6 +9,10 @@ my $button = Gtk2::Button -> new("Blub");
my $label = Gtk2::AccelLabel -> new("Bla");
isa_ok($label, "Gtk2::AccelLabel");
+# undef for no accel-widget
+$label -> set_accel_widget(undef);
+is($label -> get_accel_widget(), undef);
+
$label -> set_accel_widget($button);
is($label -> get_accel_widget(), $button);
@@ -17,5 +21,5 @@ ok(! $label -> refetch());
__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/GtkAccelLabel.xs b/xs/GtkAccelLabel.xs
index 25348d5..dd20d55 100644
--- a/xs/GtkAccelLabel.xs
+++ b/xs/GtkAccelLabel.xs
@@ -44,7 +44,7 @@ gtk_accel_label_new (class, string)
string
## GtkWidget* gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label)
-GtkWidget *
+GtkWidget_ornull *
gtk_accel_label_get_accel_widget (accel_label)
GtkAccelLabel * accel_label
@@ -57,7 +57,7 @@ gtk_accel_label_get_accel_width (accel_label)
void
gtk_accel_label_set_accel_widget (accel_label, accel_widget)
GtkAccelLabel * accel_label
- GtkWidget * accel_widget
+ GtkWidget_ornull * accel_widget
# TODO: The docs say that the "closure must be connected to an accelerator
# group", but how do we find the GClosure that was created in the xsub for
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]