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 |