filetypes wants two or more, and $open_file_types has only oneTk::Error: bad file type "ARRAY(0x22619c)", should be "typeName {exten +sion ?extensions ...?} ?{macType ?macTypes ...?}?" at site/lib/Tk.pm + line 337.
Instead of sub { File_Import() }, you want \&File_Import, or [ \&File_Import, $mw], ormy $open_file_types = [ ['NZB Files', '.nzb'] , []];
$file->command( -label => "Import", -accelerator => 'Ctrl-i', -underline => 0, -command => [ sub { my ( $mw, $file_open_dir ) = @_; my $nzb_file = $mw->getOpenFile( -title => "Select NZB File", -initialdir => $file_open_dir, -filetypes => [ [ 'NZB Files', '.nzb' ], [] ], -defaultextension => '.nzb' ); print qq{You chose to open "$nzb_file"\n} if $nzb_file; }, $mw, $file_open_dir ], );
In reply to Re: Tk::FBox getOpenFile Dialog Box stays empty
by Anonymous Monk
in thread Tk::FBox getOpenFile Dialog Box stays empty
by Kalisto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |