Package: libcdk-perl
Version: 4.9.7-6
Tags: patch

Trying to bind a key to a Cdk::Viewer object causes the script to die. This is because the wrong kind of object is used to carry out the binding.
The error message generated is "object is not of type CDKENTRYPtr at
/usr/lib/perl5/Cdk/Viewer.pm line 154."

This following code will reproduce the error.

8<=========
 use Cdk;
 Cdk::init();
 my $v=new Cdk::Viewer(Buttons => ["Ok"], Height => 22, Width => 80);
 $v->set(Title => "test", Info => [qw(a b c)]);
 $v->bind(Key => "x", Function => sub { print STDERR "test\n"; });
 my $s = $v->activate();
 Cdk::end
8<=========

A patch which fixes this issue is below.

8<=========
--- libcdk-perl-4.9.7/Cdk/Viewer.pm     1998-12-10 12:03:34.000000000 -0700
+++ libcdk-perl-4.9.7.new/Cdk/Viewer.pm 2005-06-09 12:54:45.000000000 -0600
@@ -151,7 +151,7 @@
    # Set the values.
    my $key = Cdk::checkReq ($name, "Key", $params{'Key'});
    my $function = Cdk::checkReq ($name, "Function", $params{'Function'});
-   Cdk::Entry::Bind ($self->{'Me'}, $key, $params{'Function'});
+   Cdk::Viewer::Bind ($self->{'Me'}, $key, $params{'Function'});
 }

 #
8<=========

Mat White
XMission Internet


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to