Ideally, I'd like to use the stock Win32 dialog, but I can't figure out
how to get at it.
Alternatively, I found the DirSelect.pm module. The distributed version
has a small bug in it that produces a warning with -w and use strict
(there's a my $var1, my $var2; instead of my $var1;my $var2; or my ($var1,
$var2);. I'd like to just attach the module to the end of my existing
Perl script to make sure I get the version I want, but I can't figure
out how to get it included so the AutoLoader can find it. I've got it
to the point where Tk goes to load the module, and promptly throws up
a complaint about the subroutine getting redefined, which tells me that
I've got it defined in the right place, but Tk doesn't realize it.
--
Jim Anderson (612) 782-0456 j...@acadcam.com
Anderson CAD/CAM, Inc Lucifer designed MS-DOS to try
3800 Apache Lane NE men's souls.
St Anthony, MN 55421 Then he had a better idea...
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majo...@lists.stanford.edu
my $infile = $mw->getOpenFile(-title=>'Browse & Select Data Input File',
-filetypes=>$types);
my $outfile = $mw->getOpenFile(-title=>'Output File');
if (defined $infile)
{print $infile,"\n"}
else
{print "file not specified\n"}
Dick Penny
Except that the OP wants a way to select *directories*, not files.
There is a way, using (I think) Win32::GUI, but my code that uses it is
at work, and I'm not at present.
--
Kevin Michael Vail | Dogbert: That's circular reasoning.
ke...@vaildc.net | Dilbert: I prefer to think of it as no loose ends.
http://www.vaildc.net/kevin/
>I'm trying to write a configuration utility for some software, and I'm
>looking for a way for the user to select a directory, preferably using
>only standard perl modules shipped with the current ActiveState
>distribution.
>
>Ideally, I'd like to use the stock Win32 dialog, but I can't figure out
>how to get at it.
>
>Alternatively, I found the DirSelect.pm module. The distributed version
>has a small bug in it that produces a warning with -w and use strict
>(there's a my $var1, my $var2; instead of my $var1;my $var2; or my ($var1,
>$var2);. I'd like to just attach the module to the end of my existing
>Perl script to make sure I get the version I want, but I can't figure
>out how to get it included so the AutoLoader can find it. I've got it
>to the point where Tk goes to load the module, and promptly throws up
>a complaint about the subroutine getting redefined, which tells me that
>I've got it defined in the right place, but Tk doesn't realize it.
This will show you how to do it with the Win32::GUI module, but its
not part of the standard ActiveState distribution, and the ActiveState
PPM version is corrupt. But I have installed both of the versions
shown below on ActiveState Perl's.
For Perl 5.6 use this:
http://prdownloads.sourceforge.net/perl-win32-gui/Win32-GUI-0.0.665-PPM-5.6.zip?download
For Perl 5.8 use this one:
http://perso.club-internet.fr/rocherl/Win32-GUI-PPM-58.zip
Regards,
Sheri
use Win32::FileOp;
$var = BrowseForFolder("Choose Directory", CSIDL_DESKTOP);
$var =~ s|\\|/|g; # for prettiness :)
I can't remember if Win32::FileOp is part of ActivePerl or not, but it wasn't
too hard to find if it wasn't.
It would be nice if there was a os independent package (like Tk::DirSelect)
that would use Win32::FileOp::BrowseForFolder if native, and emulate it for
other os'es.
-Mark
Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170
MIPS Technologies Mountain View CA 94043 fax 650-567-5002
On Thu, 3 Apr 2003, Jim Anderson wrote:
> I'm trying to write a configuration utility for some software, and I'm
> looking for a way for the user to select a directory, preferably using
> only standard perl modules shipped with the current ActiveState
> distribution.
>
> Ideally, I'd like to use the stock Win32 dialog, but I can't figure out
> how to get at it.
>
> Alternatively, I found the DirSelect.pm module. The distributed version
> has a small bug in it that produces a warning with -w and use strict
> (there's a my $var1, my $var2; instead of my $var1;my $var2; or my ($var1,
> $var2);. I'd like to just attach the module to the end of my existing
> Perl script to make sure I get the version I want, but I can't figure
> out how to get it included so the AutoLoader can find it. I've got it
> to the point where Tk goes to load the module, and promptly throws up
> a complaint about the subroutine getting redefined, which tells me that
> I've got it defined in the right place, but Tk doesn't realize it.
>
> Here is how to use the native Win32 folder/directory browser.
>
> use Win32::FileOp;
> $var = BrowseForFolder("Choose Directory", CSIDL_DESKTOP);
> $var =~ s|\\|/|g; # for prettiness :)
>
>
> I can't remember if Win32::FileOp is part of ActivePerl or not, but it wasn't
> too hard to find if it wasn't.
>
> It would be nice if there was a os independent package (like Tk::DirSelect)
> that would use Win32::FileOp::BrowseForFolder if native, and emulate it for
> other os'es.
>
There's one:
$CPAN/authors/id/K/KR/KRISTI/Tk-DirSelect-1.03.tar.gz
However it does not use Win32::FileOp.
Tcl/Tk 8.4 has a tk_chooseDirectory command, so it's likely Perl/Tk
804.024 will also have one.
Regards,
Slaven
--
Slaven Rezic - sla...@rezic.de
tknotes - A knotes clone, written in Perl/Tk.
http://ptktools.sourceforge.net/#tknotes
-Mark
Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170
MIPS Technologies Mountain View CA 94043 fax 650-567-5002
let me know when you find one (or write one :)... i'd use it...
-Mark
> only solutions I've seen so far involve writing out some sort of file
> and using other programs to do the printing. Can't there be a way to
> send a Canvas or something else like that to a Windows Printer using
> only standard Perl modules on a stock Win32 system? Even using the
> regular window placement functions would be nice - pack(), grid(), place(),
> etc. Then send the window to the printer.
>
> --
> Jim Anderson (612) 782-0456 j...@acadcam.com
> Anderson CAD/CAM, Inc Lucifer designed MS-DOS to try
> 3800 Apache Lane NE men's souls.
> St Anthony, MN 55421 Then he had a better idea...
>
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
A Directory selector similar to getOpenFile really should be a standard
function...
The other gigantic area missing on the Win32 systems is any reasonable
way to generate a printout using an existing Win32 printer driver. The
> > The other gigantic area missing on the Win32 systems is any reasonable
> > way to generate a printout using an existing Win32 printer driver. The
>
> let me know when you find one (or write one :)... i'd use it...
>
Please take a look at the beginnings of a Perl/Tk port for a Tcl
extension which can print directly from a canvas to a Win32 printer:
http://user.cs.tu-berlin.de/~eserte/src/perl/Tk-WinPrint/Tk-WinPrint-0.04.tar.gz
But due to lack of interest and a Visual C++ compiler I don't plan to
develop this any further, so volunteers are always welcome!
Regards,
Slaven
--
Slaven Rezic - sla...@rezic.de
tkrevdiff - graphical display of diffs between revisions (RCS or CVS)
http://ptktools.sourceforge.net/#tkrevdiff