Subject: | Directory default not intuitive. |
Date: | Mon, 11 Jun 2018 08:42:27 -0400 |
To: | bug-Tk-JFileDialog [...] rt.cpan.org |
From: | tlhackque <tlhackque [...] yahoo.com> |
Tk::JFileDialog::VERSION == 1.62
Again on Windows.
The dialog is very confusing and inconsistent with respect to
the path.
My current directory is C:\Users\tlhackque\project.
I have a filter '*.jpg" specified. There are no .jpg files.
Chooser's directory pane correctly shows:
/
.
..
foobar
baz
And nothing in Files. (foobar and baz are directories)
I enter "foo" in the filename. I enter nothing in the path, which is blank.
I click OK.
The dialog returns "C:/foo"
I expect it to return either "foo" or "C:/users/tlhackque/project/foo"
If I click "CWD", it populates path and returns what I expect by default.
The issue is that the chooser shows me something reasonable, but that's
not what the dialog returns.
If it shows me my CWD in the directory pane, (which is reasonable), the
returned path should include it.
If I select another path (with the mouse or via the form's entry box),
the directory chooser should be updated.
Bottom line: The chooser display, the path entry box, and the returned
string should always be in sync. But they are not.
I'd prefer that the dialog always return an absolute path, but a
relative path is OK IF it's really relative. C:/anyting isn't relative...
Divots aside, this is a nice module. Hope you can fix them.
Thanks.
The actual code:
my $fs = $top->JFileDialog ( -title => 'Save as',
-Create => 1, -DisableFPat => 1,
-SelectMode => 'single',
-HistFile =>
File::Spec->catfile( $home,
'imagemgr.file.history' ),
-HistDeleteOk => 1,
-PathFile =>
File::Spec->catfile( $home,
'imagemgr.path.history' ),
-SelDir => 0, -FPat => '*.jpg',
-QuickSelect => 0,
);
my $saveto = $fs->Show();
if( !defined $saveto ) {
return;
}
print( "returned '$saveto'\n");
# Prints:
returned 'C:/foo'