473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Win32::Gui Selecting the Directory

Hi

I want to select the directory path using the win32::gui.
Now i am using Win32::GUI::OpenFileName method like this

Expand|Select|Wrap|Line Numbers
  1. sub LoadFile {
  2.     $FilesPath = Win32::GUI::GetOpenFileName(
  3.         -title    => "Browse...",
  4.         -file    => "\0" . " " x 256,
  5.         -filter    => [ "Text documents (*.txt)" => "*.txt",
  6.         "All files", "*.*",],
  7.     );
  8.     return $FilesPath;
  9. }
  10.  
which is using, to select upto file but i want to select the directory only
is there any sample code for that please send me.

Thanks and redards
Ram
Mar 3 '07 #1
1 5641
Try this :

Expand|Select|Wrap|Line Numbers
  1. use Cwd;
  2. my $Directory = cwd();
  3.  
  4. sub LoadDir {
  5.   my $Dir = Win32::GUI::BrowseForFolder (
  6.                         -title     => "Select default directory",
  7.                         -directory => $Directory,
  8.                         -folderonly => 1,
  9.                         );
  10.  
  11.   $Directory = $Dir if ($Dir);
  12. }
  13.  
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: ulysses | last post by:
Hi,all I use wxPython make a bittorrent client. I find wxPython very slow and use many many memory. When app start, it need 19MB memory. I only use common GUI components. Python is a really...
2
by: Somesh Bartakkay | last post by:
I downloaded and tried a small dialog-dll's application with venster+ctypes+python 2.3 its working very well, but is it reliable to use in big projects ? or part of big projects ? wot are...
0
by: Andy | last post by:
I am trying to talk to Winamp2 from Perl on Win32 system. According to winamp docs I need to send a windows message with the following structure: (To add a file to the playlist) COPYDATASTRUCT...
7
by: Catherine Heathcote | last post by:
Its about time I started creating GUI apps, whats the best way to go about this? I want to stay cross-platform and all I know is GTK and wxWindows :S Has anyone here done cross platform GUI's? ...
1
by: Tony Boloney | last post by:
Hi all, I'm trying to use the method described in the article Adding Console I/O to a Win32 GUI App http://dslweb.nwnexus.com/~ast/dload/guicon.htm to output info to a separate console...
3
by: Radith Silva | last post by:
SORRY; I'M SURE IT'S THE WRONG FORUM; BUT I'M SURE Y'ALL WOULD KNOW THE ANSWER!!! Hi; I was just wondering if you could build GUI's in C (original C). From what I've seen, the programs made...
6
by: Gilles Ganault | last post by:
Hello It looks like the development of the PyWin32 wrapper to the Win32 API stopped years ago, which is too bad because it means that writing GUI apps in Python even just for Windows means...
4
by: Perl Beginner | last post by:
I have created a GUI window using Perl Win32::XMLBuilder. This window has several buttons on it, that when a button is clicked another Perl script will execute. When the script is complete, the GUI...
1
by: Perl Beginner | last post by:
Hello all, I have created a GUI box using Win32::GUI::Window and all i want to do is add a question mark icon in the window on the left, but i'm having trouble figuring that out. i know that using...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.