From: Frazier, J. J. <Joe.Frazier@PeopleClick.com> - 2001-10-19 18:49:41
|
From GUI.xs, here is the definition:=20 # (@)METHOD:GetSaveFileName(%OPTIONS) # Allowed %OPTIONS are: # -owner =3D> WINDOW # [TBD] # -title =3D> STRING # the title for the dialog # -directory =3D> STRING # specifies the initial directory # -file =3D> STRING # specifies a name that will appear on the dialog's edit field # -filter =3D> ARRAY REFERENCE # [TBD] Here is an example from sfn.pl ( included example in the source distribution) Add "-directory =3D> something" to the sub arg to start in a particular folder I have never used the -owner flag, so I have no idea what it does. <CODE> use Win32::GUI; $file =3D "\0" . " " x 256; $ret =3D GUI::GetSaveFileName( -title =3D> "Win32::GUI::GetSaveFileName test", -file =3D> "\0" . " " x 256, -filter =3D> [ "Text documents (*.txt)" =3D> "*.txt",=20 "Perl stuff (*.pl, *.pm)" =3D> "*.pl;*.pm",=20 "All files", "*.*", ], ); if($ret) { print "GetSaveFileName returned: '$ret'\n"; } else { if(GUI::CommDlgExtendedError()) { print "ERROR. CommDlgExtendedError is: ", GUI::CommDlgExtendedError(), "\n"; =20 } else { print "You cancelled.\n"; } } </CODE> Basically, if $ret is defined, it is the full path to the file you want to save. You can then perfom open, pipe, pass to constructors which take a filename, etc. Also, for the Openfile, you may want to play with the Win32::GUI::BrowseForFolder function AND look back on the list several weeks for Win32::FileOp reference. It includes a better Openfilename function in that you can specify a flag to open multiple file names amoung other options not available(currently) in the Win32::GUI::GetOpenFileName function. > -----Original Message----- > From: Joseph_Vieira@DMR.COM [mailto:Joseph_Vieira@DMR.COM] > Sent: Friday, October 19, 2001 1:53 PM > To: per...@li... > Subject: [perl-win32-gui-users] Save file window >=20 >=20 >=20 > Hello, >=20 > I was looking at the sample perl scripts and came accross=20 > ofn.pl, it uses > Win32::GUI::GetOpenFileName. Which opens up an open file=20 > window. Created > and ready to use with all the buttons. Cool. I couldn't find it > documented any where and now I am wondering if there is a=20 > save file window > (I really hope so). I'd rather not have to create one if=20 > it's already been > done. Does anyone know? >=20 > Thanks, >=20 > Joe >=20 >=20 >=20 >=20 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >=20 |