Tk::FileSelect hangs on W98 root directory

R

Richard Trahan

I'm running ActiveState build 811 on W98. When using Tk::FileSelect,
attempting to navigate to the root directory of any drive hangs the
interpeter. There is no mention of this problem in this ng. Is anyone
else experiencing this?
 
A

A. Sinan Unur

I'm running ActiveState build 811 on W98. When using Tk::FileSelect,
attempting to navigate to the root directory of any drive hangs the
interpeter. There is no mention of this problem in this ng. Is anyone
else experiencing this?

How about a short, complete script that still exhibits the problem so that
others can try it out?

Please read the posting guidelines for this group. They contain valuable
information on how to help yourself as well as on how to help others help
you.

Sinan
 
R

Richard Trahan

A. Sinan Unur said:
How about a short, complete script that still exhibits the problem so that
others can try it out?
use strict;
use Tk;
use Tk::FileSelect;

our $mw = MainWindow->new;
$mw->Button(
-command => \&fs
)->pack;

MainLoop;

sub fs
{
$mw->FileSelect(-directory => "c:/windows/temp")->Show;
}

The above program will allow me to click up to /windows, but if I go
higher, the program hangs.
 
R

Richard Trahan

W. Citoan said:
Your example code works fine for me (811 on XP). A quick Google search
shows that this appears to be a known problem on 98.
http://groups-beta.google.com/groups?q=perl windows 98 FileSelect
Look at the 1st and 2nd thread. The first thread suggests using
getOpenFile instead (which uses the standard Windows interface).

- W. Citoan

Thank you for your response. I will use that method, but there is still
something wrong with it.

The example shown in the Perl html page for getOpenFile shows a
variable, $types, as a list of lists, and it works ok as shown, but if
you reduce this list to a single line, you get a syntax error. Specifically:
my $types = [
['Text Files', ['.txt','.text']],
];
will not work. IMO, this is clearly a bug. Notice also that the syntax
of $types is inconsistent with the description under the heading
"Specifying File Patterns"; the $types example shows an extra level of
list nesting.

It's too bad they didn't fix FileSelect; getOpenFile is not quite the
same because it isn't a widget and it allows the user to do things I
don't want him/her to do, like delete files and create directories.

In the context of the birth and death of galaxies, I suppose it's not
that important.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top