Subject: | Bug in getOpenFile/getSaveFile |
I think it's a bug, that getOpenFile needs at least two elements in the
array for -filetypes.
#!/usr/bin/perl
use Tk;
my $mw = MainWindow->new();
my $filetypes = [['pdf','.pdf']];
$mw->getOpenFile(-filetypes => $filetypes);
MainLoop;
produces the following error message:
bad file type "ARRAY(0x1a5b338)", should be "typeName {extension ?extensions ...
?} ?{macType ?macTypes ...?}?" at C:/usr/lib/Tk.pm line 320.
But the following code works fine:
#!/usr/bin/perl
use Tk;
my $mw = MainWindow->new();
my $filetypes = [['pdf','.pdf'],['pdf','.pdf']];
$mw->getOpenFile(-filetypes => $filetypes);
MainLoop;
My system:
OS:
Microsoft Windows XP [Version 5.1.2600]
Perl:
This is perl, v5.8.6 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)
Copyright 1987-2004, Larry Wall
Binary build 811 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Dec 13 2004 09:52:01
Tk:
C:\>perl -MTk -le "print $Tk::VERSION"
804.027