Re: tk_getopenfile - PERL - WINDOWS

[email protected] (Jeff Hobbs) Tue, 07 Dec 2010 14:13:31 -0800
Newsgroups perl.tcltk
Message-ID <[email protected]>
On 07/12/2010 10:35 AM, gary sachs wrote:
> Using AS PERL v5.12 on Windows XP. Trying to use the tk_getopenfile with a file types list. If I specify a default extension and intialfile type I can see those types of files if they exist. If I select a different file type from the pull down, the files all disappear and nothing shows up matching the selected file type even when they exist. Is there a bug?
>
> here is a code snippet:
>
> my $types = [ ['CSV files', ['.csv']],
> 		  ['ZIP files', ['.zip']],
> 		  ['ALL files', ['*']],
> 		];
>
> $filelist = Tkx::tk___getOpenFile(-multiple =>  1, -title =>  "Open a CSV File",
> 				      -defaultextension =>  '.csv',
> 				      -initialfile =>  '*.csv',
> 				      -filetypes =>  $types,
> 				      -initialdir =>  'c:\temp',
> 				      );

That exact snippet of code worked for me with ActivePerl 5.12.2 on 
Windows Vista.  I don't see why XP might make a difference.  Are you 
sure that you have both csv and zip files in the directories?  Is there 
possibly some other interaction involved?  All I did was add 'use Tkx;' 
at the top and 'Tkx::MainLoop();' at the bottom.

Jeff