Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: win32-FileOp module for strawberry

by marto (Cardinal)
on Nov 04, 2022 at 12:55 UTC ( [id://11147964]=note: print w/replies, xml ) Need Help??


in reply to win32-FileOp module for strawberry

Can you post a SSCCE?

Replies are listed 'Best First'.
Re^2: win32-FileOp module for strawberry
by srikrishnan (Beadle) on Nov 04, 2022 at 13:56 UTC

    Hi Marto

    Thanks for your response. Below i have pasted my sample code.

    use Tk; use Win32::FileOp; my $mw = MainWindow -> new; my $frmWidth = 452; my $frmHeigt = 50; my $screenypos = $mw->screenheight(); my $screenxpos = $mw->screenwidth(); $screenxpos = $screenxpos - $frmWidth; + + $screenxpos = $screenxpos/2; $screenypos = $screenypos - $frmHeigt; $screenypos = $screenypos/2; $mw->geometry("${frmWidth}x$frmHeigt+$screenxpos+$screenypos"); $mw->resizable('no', 'no'); $mw->title ("Test"); my $mainFrame = $mw -> Frame -> pack (-side => 'top', -padx => '8', -p +ady => '10'); $BrowseFrame = $mainFrame -> Frame() -> pack (-side => 'top', -pady => + '5'); $BrowseFrame -> Button (-text => 'Select folder', -command => \&gotoFi +le, -background => '#ccccff', -activebackground => '#6666ff') -> pack + (-side => 'left', -padx => '5'); $BrowseFrame -> Entry (-textvariable => \$filepath, -width => '84', -b +ackground => '#ccccff') -> pack (-side => 'left', -padx => '2'); $mw->update; MainLoop; sub gotoFile { $filepath = BrowseForFolder ("Choose Directory", CSIDL_DRIVES, BIF +_RETURNONLYFSDIRS); $mw->Unbusy; return 'Cancel' unless($filepath); return; }

    Thanks

    Srikrishnan

      Why wouldn't you use Tk::chooseDirectory if it's Tk application anyway? Seems to work as advertised.

      I don't have that Tk module installed on my system, but as guess without testing, I would change:
      $filepath = BrowseForFolder ("Choose Directory", CSIDL_DRIVES, BIF_RET +URNONLYFSDIRS); to $filepath = $mw->BrowseForFolder ("Choose Directory", CSIDL_DRIVES, BI +F_RETURNONLYFSDIRS);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147964]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-29 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found