Skip Menu |

This queue is for tickets about the Tk-JFileDialog CPAN distribution.

Report information
The Basics
Id: 125539
Status: resolved
Worked: 8 hours (480 min)
Priority: 0/
Queue: Tk-JFileDialog

People
Owner: turnerjw784 [...] yahoo.com
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.0



Subject: SelectMultiple 1 incompatible with Create 0
Date: Sat, 9 Jun 2018 21:22:12 -0400
To: bug-Tk-JFileDialog [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
Tk::JFileDialog::VERSION == 1.62 It seems that one can specify Create => 0 OR SelectMode =>'multiple. But not both. Simple reproducer:     my $fs = $top->JFileDialog (                                  -Create => 0,                                  -SelectMode => 'multiple');  my $file = $fs->Show; Select 2 files, click OK. Error Dialog: "file.1,file.2 must exist". Clearly, the existence check is looking for the whole return value. It should be doing a split /,/ on the value, and ensuring that ALL files exist. Semi-related: if I set SelDir => 2 and set an FPat (e.g. *.jpg), the FPat seems to prevent the directories (not named dir.jpg) from being visible. I suspect that you need a DPat (Directory pattern match) separate from FPat to handle the general case.  Or simply don't apply FPat to directories.
On Sat Jun 09 21:22:37 2018, tlhackque wrote: Show quoted text
> Tk::JFileDialog::VERSION == 1.62 > > It seems that one can specify > Create => 0 OR SelectMode =>'multiple. > > But not both. > > Simple reproducer: >     my $fs = $top->JFileDialog ( >                                  -Create => 0, >                                  -SelectMode => 'multiple'); >  my $file = $fs->Show; > > Select 2 files, click OK. > > Error Dialog: "file.1,file.2 must exist". > > Clearly, the existence check is looking for the whole return value. > > It should be doing a split /,/ on the value, and ensuring that ALL > files > exist. > > Semi-related: > > if I set SelDir => 2 and set an FPat (e.g. *.jpg), the FPat seems to > prevent > the directories (not named dir.jpg) from being visible. > > I suspect that you need a DPat (Directory pattern match) separate from > FPat > to handle the general case.  Or simply don't apply FPat to > directories. >
Confirmed, will fix and update... Thanks for reporting! Jim
I've done alot of work on this module last week (this is some really old (20+ years) code and was overdue for some work! I've attached a pre-release version that should address all the issues you've reported and requested along with some other shiny new features. Please test and let me know if any issues remain. Thank you, Jim
Subject: JFileDialog.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #125539] SelectMultiple 1 incompatible with Create 0
Date: Mon, 18 Jun 2018 16:01:50 -0400
To: bug-Tk-JFileDialog [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
On 18-Jun-18 15:30, Jim Turner via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=125539 > > > I've done alot of work on this module last week (this is some really old (20+ years) code and was overdue for some work! I've attached a pre-release version that should address all the issues you've reported and requested along with some other shiny new features. Please test and let me know if any issues remain. > > Thank you, > > Jim >
Thanks, I'll give it a whirl soon. Old isn't bad.  People or code :-) Quick scan of your code raises a couple of questions: The POD refers to $ENV{HOME}; the code (appropriately ) also uses windoze HOMEDRIVE and HOMEDIR.  The POD should be updated. I notice that you try to import HIDDEN, then use it the same way.  This won't work on Unix, where the constant isn't defined.  You'll have to reference it as HIDDEN() (as my sample does), or use constant it on non-windoze. I'm not sure that your $^O test is wise - 'win' doesn't only mean MS windows.  Suggest comparing explicitly for what you've tested and support.  e.g. $^O =~ /^(?:MSWin32|cygwin)$/.  Of course cygwin is a Unix-ish environment, and testing.  And darwin matches - but isn't windows.  See https://metacpan.org/source/PERLANCAR/Perl-osnames-0.11/lib/Perl/osnames.pm for some examples. In general, you need to test this under at least windoze (native, cygwin) and Unix (at least linux).  VMS still exists, but that's another challenge.  (Easy to run VMS under a simulator - see http://www.trailing-edge.com/simh for one.) I'll give it a real try when I hit a stable point in my project.  Should be within a few daze. Thanks again.
Subject: Re: [rt.cpan.org #125539] Progress report - breakage
Date: Mon, 18 Jun 2018 18:14:29 -0400
To: bug-Tk-JFileDialog [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
On 18-Jun-18 15:30, Jim Turner via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=125539 > > > I've done alot of work on this module last week (this is some really old (20+ years) code and was overdue for some work! I've attached a pre-release version that should address all the issues you've reported and requested along with some other shiny new features. Please test and let me know if any issues remain. > > Thank you, > > Jim >
Don't get far. I have a fresh install of perl 5.26.1 (activestate). I installed your latest released version from cpan. I put the file you sent into '.'. I changed my application from 'use Tk::JFileDialog'  to 'use 'JFileDialog' for testing. I run my application with perl -d -I . I set a breakpoint just before using the widget, confirm its version, continue. next, I enter "bar.jpg" into the filename box, click ok. You crash. The failure is at line 810: $self->update;     $self->grab('release') if (defined($self->grab('current')));     $self->parent->state('normal'); <<** Here Old version ( no -I, use includes TK) works as before (of course, I have to click "CWD" first). Note there are some errors, but no failures in the install, also below. my code: our $home  = $^O eq 'MSWin32'?   File::Spec->catpath( $ENV{HOMEDRIVE}, $ENV{HOMEPATH} ): $ENV{HOME};     my $fs = $win->{tab}->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;     } Here are the relevant commands:   DB<4> x $Tk::JFileDialog::VERSION 0  '2.0b1'   DB<5> c Tk::Error: Failed to AUTOLOAD 'Tk::Frame::state' at C:/Users/tlhackque/Software/Development/cdindex/ManageGUI.pm line 829.  Carp::croak at C:/Perl64/lib/Carp.pm line 167  Tk::Widget::__ANON__[C:/Perl64/site/lib/Tk/Widget.pm:347] at C:/Perl64/site/lib/Tk/Widget.pm line 347  Tk::JFileDialog::Show at C:/Users/tlhackque/Software/Development/cdindex/JFileDialog.pm line 810  ManageGUI::saveimage at C:/Users/tlhackque/Software/Development/cdindex/ManageGUI.pm line 829  ManageGUI::__ANON__[C:/Users/tlhackque/Software/Development/cdindex/ManageGUI.pm:351] at C:/Users/tlhackque/Software/Development/cdindex/ManageGUI.pm line 350  Tk callback for .notebook.cDMGR.frame1.frame1.frame1.frame1.button1  Tk::__ANON__[C:/Perl64/site/lib/Tk.pm:251] at C:/Perl64/site/lib/Tk.pm line 251  Tk::Button::butUp at C:/Perl64/site/lib/Tk/Button.pm line 177  <ButtonRelease-1>  (command bound to event) +++++++++++ pan install Tk::JFileDialog Loading internal null logger. Install Log::Log4perl for logging messages CPAN: Term::ANSIColor loaded ok (v4.06) Reading 'C:\Perl64\cpan\Metadata'   Database was generated on Mon, 18 Jun 2018 05:54:12 GMT Running install for module 'Tk::JFileDialog' CPAN: LWP::UserAgent loaded ok (v6.29) CPAN: Time::HiRes loaded ok (v1.9746) Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TU/TURNERJW/Tk-JFileDialog-1.62.tar.gz CPAN: YAML::XS loaded ok (v0.66) CPAN: Digest::SHA loaded ok (v5.98) Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TU/TURNERJW/CHECKSUMS CPAN: Compress::Zlib loaded ok (v2.074) Checksum for C:\Perl64\cpan\sources\authors\id\T\TU\TURNERJW\Tk-JFileDialog-1.62.tar.gz ok CPAN: Archive::Tar loaded ok (v2.26) Tk-JFileDialog-1.62/ Tk-JFileDialog-1.62/JFileDialogTest.pl Tk-JFileDialog-1.62/README Tk-JFileDialog-1.62/test.pl Tk-JFileDialog-1.62/META.yml Tk-JFileDialog-1.62/META.json Tk-JFileDialog-1.62/MANIFEST Tk-JFileDialog-1.62/lib/ Tk-JFileDialog-1.62/lib/Tk/ Tk-JFileDialog-1.62/lib/Tk/JFileDialog.pm Tk-JFileDialog-1.62/Makefile.PL CPAN: CPAN::Meta::Requirements loaded ok (v2.140) CPAN: Parse::CPAN::Meta loaded ok (v2.150010) CPAN: CPAN::Meta loaded ok (v2.150010) CPAN: Module::CoreList loaded ok (v5.20171120) Configuring T/TU/TURNERJW/Tk-JFileDialog-1.62.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Warning: prerequisite Tk::JBrowseEntry 4.63 not found. Generating a dmake-style Makefile Writing Makefile for Tk::JFileDialog Writing MYMETA.yml and MYMETA.json   TURNERJW/Tk-JFileDialog-1.62.tar.gz   C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- OK Running make for T/TU/TURNERJW/Tk-JFileDialog-1.62.tar.gz Show quoted text
---- Unsatisfied dependencies detected during ---- ----    TURNERJW/Tk-JFileDialog-1.62.tar.gz   ----     Tk::JBrowseEntry [requires] Running install for module 'Tk::JBrowseEntry' Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TU/TURNERJW/Tk-JBrowseEntry-4.8.tar.gz Checksum for C:\Perl64\cpan\sources\authors\id\T\TU\TURNERJW\Tk-JBrowseEntry-4.8.tar.gz ok Tk-JBrowseEntry-4.8/ Tk-JBrowseEntry-4.8/Makefile.PL Tk-JBrowseEntry-4.8/Changes Tk-JBrowseEntry-4.8/MANIFEST Tk-JBrowseEntry-4.8/JBrowseEntry.htm Tk-JBrowseEntry-4.8/test.pl Tk-JBrowseEntry-4.8/lib/ Tk-JBrowseEntry-4.8/lib/Tk/ Tk-JBrowseEntry-4.8/lib/Tk/JBrowseEntry.pm Tk-JBrowseEntry-4.8/JBrowseTest.pl Tk-JBrowseEntry-4.8/META.yml Tk-JBrowseEntry-4.8/README Configuring T/TU/TURNERJW/Tk-JBrowseEntry-4.8.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a dmake-style Makefile Writing Makefile for Tk::JBrowseEntry Writing MYMETA.yml and MYMETA.json   TURNERJW/Tk-JBrowseEntry-4.8.tar.gz   C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- OK Running make for T/TU/TURNERJW/Tk-JBrowseEntry-4.8.tar.gz cp lib/Tk/JBrowseEntry.pm blib\lib\Tk/JBrowseEntry.pm "C:\Perl64\bin\perl.exe" -MExtUtils::Command -e cp -- JBrowseTest.pl blib\script\JBrowseTest.pl pl2bat.bat blib\script\JBrowseTest.pl   TURNERJW/Tk-JBrowseEntry-4.8.tar.gz   C:\Perl64\site\bin\dmake.exe -- OK Running make test "C:\Perl64\bin\perl.exe" "-Iblib\lib" "-Iblib\arch" test.pl 1..2 ok 1 '.' is not recognized as an internal or external command, operable program or batch file. not ok 2 (256) ..done: 2 tests completed.   TURNERJW/Tk-JBrowseEntry-4.8.tar.gz   C:\Perl64\site\bin\dmake.exe test -- OK Running make install Prepending C:\Perl64\cpan\build\Tk-JBrowseEntry-4.8-0/blib/arch C:\Perl64\cpan\build\Tk-JBrowseEntry-4.8-0/blib/lib to PERL5LIB for 'install' Installing C:\Perl64\html\site\lib\Tk\JBrowseEntry.html Installing C:\Perl64\site\lib\Tk\JBrowseEntry.pm Installing C:\Perl64\site\bin\JBrowseTest.bat Installing C:\Perl64\site\bin\JBrowseTest.pl Appending installation info to C:\Perl64\lib/perllocal.pod   TURNERJW/Tk-JBrowseEntry-4.8.tar.gz   C:\Perl64\site\bin\dmake.exe install  -- OK   TURNERJW/Tk-JFileDialog-1.62.tar.gz   Has already been unwrapped into directory C:\Perl64\cpan\build\Tk-JFileDialog-1.62-0   TURNERJW/Tk-JFileDialog-1.62.tar.gz   Has already been prepared Running make for T/TU/TURNERJW/Tk-JFileDialog-1.62.tar.gz cp lib/Tk/JFileDialog.pm blib\lib\Tk/JFileDialog.pm "C:\Perl64\bin\perl.exe" -MExtUtils::Command -e cp -- JFileDialogTest.pl blib\script\JFileDialogTest.pl pl2bat.bat blib\script\JFileDialogTest.pl   TURNERJW/Tk-JFileDialog-1.62.tar.gz   C:\Perl64\site\bin\dmake.exe -- OK Running make test "C:\Perl64\bin\perl.exe" "-Iblib\lib" "-Iblib\arch" test.pl 1..2 ok 1 '.' is not recognized as an internal or external command, operable program or batch file. not ok 2 (256) ..done: 2 tests completed.   TURNERJW/Tk-JFileDialog-1.62.tar.gz   C:\Perl64\site\bin\dmake.exe test -- OK Running make install Prepending C:\Perl64\cpan\build\Tk-JFileDialog-1.62-0/blib/arch C:\Perl64\cpan\build\Tk-JFileDialog-1.62-0/blib/lib to PERL5LIB for 'install' Installing C:\Perl64\html\site\lib\Tk\JFileDialog.html Installing C:\Perl64\site\lib\Tk\JFileDialog.pm Installing C:\Perl64\site\bin\JFileDialogTest.bat Installing C:\Perl64\site\bin\JFileDialogTest.pl Appending installation info to C:\Perl64\lib/perllocal.pod   TURNERJW/Tk-JFileDialog-1.62.tar.gz   C:\Perl64\site\bin\dmake.exe install  -- OK ++++++ perl -V Summary of my perl5 (revision 5 version 26 subversion 1) configuration:   Platform:     osname=MSWin32     osvers=6.1     archname=MSWin32-x64-multi-thread     uname=''     config_args='undef'     hint=recommended     useposix=true     d_sigaction=undef     useithreads=define     usemultiplicity=define     use64bitint=define     use64bitall=undef     uselongdouble=undef     usemymalloc=n     default_inc_excludes_dot=define     bincompat5005=undef   Compiler:     cc='C:\Perl64\site\bin\gcc.exe'     ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields'     optimize='-s -O2'     cppflags='-DWIN32'     ccversion=''     gccversion='4.6.3'     gccosandvers=''     intsize=4     longsize=4     ptrsize=8     doublesize=8     byteorder=12345678     doublekind=3     d_longlong=define     longlongsize=8     d_longdbl=define     longdblsize=16     longdblkind=3     ivtype='long long'     ivsize=8     nvtype='double'     nvsize=8     Off_t='long long'     lseeksize=8     alignbytes=8     prototype=define   Linker and Libraries:     ld='C:\Perl64\site\bin\g++.exe'     ldflags ='-s -static-libgcc -static-libstdc++ -L"C:\Perl64\lib\CORE" -L"C:\MinGW\x86_64-w64-mingw32\lib"'     libpth=C:\MinGW\x86_64-w64-mingw32\lib     libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32     perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32     libc=     so=dll     useshrplib=true     libperl=libperl526.a     gnulibc_version=''   Dynamic Linking:     dlsrc=dl_win32.xs     dlext=dll     d_dlsymun=undef     ccdlflags=' '     cccdlflags=' '     lddlflags='-mdll -s -static-libgcc -static-libstdc++ -L"C:\Perl64\lib\CORE" -L"C:\MinGW\x86_64-w64-mingw32\lib"' Characteristics of this binary (from libperl):   Compile-time options:     HAS_TIMES     HAVE_INTERP_INTERN     MULTIPLICITY     PERLIO_LAYERS     PERL_COPY_ON_WRITE     PERL_DONT_CREATE_GVSV     PERL_IMPLICIT_CONTEXT     PERL_IMPLICIT_SYS     PERL_MALLOC_WRAP     PERL_OP_PARENT     PERL_PRESERVE_IVUV     USE_64_BIT_INT     USE_ITHREADS     USE_LARGE_FILES     USE_LOCALE     USE_LOCALE_COLLATE     USE_LOCALE_CTYPE     USE_LOCALE_NUMERIC     USE_LOCALE_TIME     USE_PERLIO     USE_PERL_ATOF     USE_SITECUSTOMIZE   Locally applied patches:     ActivePerl Build 2601 [404865]   Built under MSWin32   Compiled at Dec 11 2017 12:23:25   @INC:     C:/Perl64/site/lib     C:/Perl64/lib

Message body is not shown because it is too large.

I don't think that's gonna work. For testing, I'd rename your current version Tk/JFileDialog.pm to Tk/JFileDialog.prod (or whatever you like), then rename the one I sent you to Tk/JFileDialog.pm. I'll fix the POD, HIDDEN & /Win/ OS matching issues you mentioned. I'm running Linux and not having any issues (it's not hit if running "Windows"(bummer! lol)). That's also why you're having issues in general, b/c I originally bolted on the Windows (ie. drive letters, etc.) stuff way back when, and haven't hardly used Windows since, so very little testing (and knowledge) of it over the years for me. I'm glad to see someone actually using it in Windows though, which is enabling me to clean that stuff up!
Subject: Re: [rt.cpan.org #125539] SelectMultiple 1 incompatible with Create 0
Date: Tue, 19 Jun 2018 13:10:27 -0400
To: bug-Tk-JFileDialog [...] rt.cpan.org
From: tlhackque <tlhackque [...] yahoo.com>
On 19-Jun-18 11:37, Jim Turner via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=125539 > > > I don't think that's gonna work. For testing, I'd rename your current version Tk/JFileDialog.pm to Tk/JFileDialog.prod (or whatever you like), then rename the one I sent you to Tk/JFileDialog.pm. I'll fix the POD, HIDDEN & /Win/ OS matching issues you mentioned. I'm running Linux and not having any issues (it's not hit if running "Windows"(bummer! lol)). That's also why you're having issues in general, b/c I originally bolted on the Windows (ie. drive letters, etc.) stuff way back when, and haven't hardly used Windows since, so very little testing (and knowledge) of it over the years for me. I'm glad to see someone actually using it in Windows though, which is enabling me to clean that stuff up!
I mostly do Linux - except for this project, where windows turns out to be a better fit. The HIDDEN coding can't compile on Linux (at least with strict), because the bareword won't compile.  So if you're running that code there, something is strange.  Or I missed something in my quick scan.  Coding it as HIDDEN() will work because an undefined sub is OK as long as it's never reached.  use constant compiles into subs... Once a word is defined as a sub, it can be used without ().  But importing the symbol only under windows won't work.   Even in a BEGIN - when the subsequent code compiles, it should see "bareword, not a sub or IO handled; tilt." I rather suspect that the crash issue may be that you have changes in other files since cpan.  Which is why I'm inclined not to make any changes in site as I might get distracted & forget about them. I'll sort that out when you have another update.  Or you can just do a TRIAL release to CPAN - which has the advantage of testing the packaging too.  Anyhow, thanks for working on this.  Meantime, I have plenty to do.
Fixed in v2.0, just released. Jim. On Tue Jun 19 13:10:59 2018, tlhackque wrote: Show quoted text
> On 19-Jun-18 11:37, Jim Turner via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=125539 > > > > > I don't think that's gonna work. For testing, I'd rename your > > current version Tk/JFileDialog.pm to Tk/JFileDialog.prod (or whatever > > you like), then rename the one I sent you to Tk/JFileDialog.pm. I'll > > fix the POD, HIDDEN & /Win/ OS matching issues you mentioned. I'm > > running Linux and not having any issues (it's not hit if running > > "Windows"(bummer! lol)). That's also why you're having issues in > > general, b/c I originally bolted on the Windows (ie. drive letters, > > etc.) stuff way back when, and haven't hardly used Windows since, so > > very little testing (and knowledge) of it over the years for me. I'm > > glad to see someone actually using it in Windows though, which is > > enabling me to clean that stuff up!
> I mostly do Linux - except for this project, where windows turns out > to > be a better fit. > > The HIDDEN coding can't compile on Linux (at least with strict), > because > the bareword won't compile.  So if you're running that code there, > something is strange.  Or I missed something in my quick scan.  Coding > it as HIDDEN() will work because an undefined sub is OK as long as > it's > never reached.  use constant compiles into subs... Once a word is > defined as a sub, it can be used without ().  But importing the symbol > only under windows won't work.   Even in a BEGIN - when the subsequent > code compiles, it should see "bareword, not a sub or IO handled; > tilt." > > I rather suspect that the crash issue may be that you have changes in > other files since cpan.  Which is why I'm inclined not to make any > changes in site as I might get distracted & forget about them. > > I'll sort that out when you have another update.  Or you can just do a > TRIAL release to CPAN - which has the advantage of testing the > packaging > too. > > Anyhow, thanks for working on this.  Meantime, I have plenty to do.