Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Proposed change to FBox.pm
Currently, getOpenFile and getSaveFile do not apply any
filter to directory names.  This can be a problem in the
user's home directory on Unix/Linux where there can be many
hidden directories cluttering the selection box.

The patch below adds a -hiddendirs attribute in FBox.pm.
The default value is true = show hiddendirs, which is backward
compatible.  Setting it to false will hide directories whose
name starts with '.'.

Hidden directories are generally less of a problem on
Windows, although testing the ^O value and checking the
file attribute could be done with a little work.

Try it out and post back here whether you think it would be useful
or not.


*** FBox.pm.orig        Sat Mar 22 18:28:03 2008
--- FBox.pm     Sat Mar 22 18:38:50 2008
***************
*** 221,226 ****
--- 221,227 ----
-filter           => ['PASSIVE', undef, undef,
'*'],
-force            => ['PASSIVE', undef, undef, 0],
-multiple         => ['PASSIVE', undef, undef, 0],
+                   -hiddendirs       => ['PASSIVE', undef, undef, 1],
'DEFAULT'         => [$icons],
);
# So-far-failed attempt to break reference loops ...
***************
*** 428,433 ****
--- 429,435 ----
$icons->DeleteAll;

# Make the dir & file list
+     my $showhidden = $w->cget(-hiddendirs);
my $cwd = _cwd();
local *FDIR;
if (opendir(FDIR, $cwd)) {
***************
*** 451,457 ****
next if -f $f && $f !~ m!$flt!;
}
if (-d $f) {
!               $icons->Add($folder, $f);
} else {
push @files, $f;
}
--- 453,459 ----
next if -f $f && $f !~ m!$flt!;
}
if (-d $f) {
!               $icons->Add($folder, $f) if ($showhidden || substr($f,
0,1) ne '.');
} else {
push @files, $f;
}


*** getOpenFile.pod.orig        Sat Mar 22 18:43:41 2008
--- getOpenFile.pod     Sat Mar 22 18:48:15 2008
***************
*** 70,75 ****
--- 70,81 ----
Rather, the I<General Controls> control panel on the Mac allows the
end user to override the application default directory.

+ =item B<-hiddendir> =E<gt> I<value>
+
+ Setting this to false prevents directory names starting with '.'
from
+ being displayed.  Note that filetype filters are not applied to
+ directory names.  Default value is true.
+
=item B<-initialfile> =E<gt> I<filename>

Specifies a filename to be displayed in the dialog when it pops

Report this thread to moderator Post Follow-up to this message
Old Post
smallpond
03-23-08 12:08 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:56 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.