This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem with Perl/Tk and Pixmap


Andrew DeFaria wrote on 2010-12-16: 
>   On 12/16/2010 02:07 PM, Johannes v. Löwis wrote:
>> I have a Perl/Tk script that is supposed to show a pixmap on the left
>> side of the title bar of the main window. It works on Linux and on a
>> rather old version of Cygwin 1.5.
>> On Cygwin 1.7 (on XP Home and Prof) the following happens:
>> 
>> $ ./logotest.pl Can't bless non-reference value at
>> /usr/lib/perl5/vendor_perl/5.10/i686-cygwin/Tk/Image.pm line 23.
...
>> Any ideas or suggestions what further information I could provide
>> in order to sort this out?
>> 
> Reproduced. Note you problem appears to be with Tk::Image, not with
> Cygwin, though you are right in that it works on Linux and complains and
> dies on Cygwin.
> 
> Interestingly, if you run your program and the Perl debugger (i.e. perl
> -d logtest.pl) then simply type c for continue it works fine.
> 
> Looking at Image.pm I see that if I break at Image.pm:23 there's a
> "return bless $obj,$package" statement. In the debugger, $obj is defined
> and there's no problem. If, however, I just run this without the
> debugger, but put some print statements in Image.pm, I see that $obj is
> indeed returned from $widget->Tk::image as undefined.
> 
> This appears to be a Perl/Tk bug.
> 
> Even stranger! Change your
> 
>    $mw->Pixmap('logo', -data=>$icon);
> to
> 
>    my $foo $mw->Pixmap('logo', -data=>$icon);
> and it works! So you have  a work around, and a bug to report.

I also can reproduce the problem.

This behavior reminds me of a perl-Tk packaging bug from last year:

http://www.cygwin.com/ml/cygwin/2009-07/msg00890.html

In fact, /usr/bin/widget seems to be broken again, unless you run it in the perl debugger:

thrall@pc1163-8413-xp ~
$ /usr/bin/widget
Can't set -labelFont to `Courier 12 bold' for Tk::LabEntry=HASH(0x1067dac0): unknown option "-labelFont" at /usr/lib/perl5/vendor_perl/5.10/i686-cygwin/Tk/Derived.pm line 294.

 at /usr/lib/perl5/vendor_perl/5.10/i686-cygwin/Tk/Derived.pm line 306
thrall@pc1163-8413-xp ~
$ cygcheck -cd perl perl-Tk
Cygwin Package Information
Package              Version
cygwin               1.7.7-1
perl                 5.10.1-4
perl-Tk              804.029-1

--
Bryan Thrall
FlightSafety International
bryan.thrall@flightsafety.com
? 



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]