Tk::DirTree problems with subdirectories of 'C:' under Win32 
Author Message
 Tk::DirTree problems with subdirectories of 'C:' under Win32

Happy new year to all!

Using DirTree with the option -directory I get the following problem: If I
use the value 'C:' for this option only the path for the current directory
is shown and I don't get all the subdirectories of C:\ . Taking an other
volume as default directory it works correctly.

My code:
   use strict;
   use Tk;
   my $mw = MainWindow->new();
   my $label = $mw->Label(-width=>35);
   my $dtree = $mw->Scrolled('DirTree', -scrollbars => 'se' ,
         -height => 25, -width => 35,
                       -background => 'snow1',
                       -selectbackground => 'blue4',
                       -selectforeground => 'snow1',
         -directory => 'C:',
                       -browsecmd  => sub {
                                 my $file = shift;
                                 $label->configure(-text=>$file);
                              }
                       );
#
   $dtree->grid(-column => 0, -row => 0, -sticky => 'e');
   $label->grid(-column => 0, -row => 1, -sticky => 'e');
#
   MainLoop;

The only one way I found to show all the subdirectories of C:\ is to set the
value of the -directory-option to "" . But this shows a slash on top of the
tree instead of the directory C:\ .

What's wrong??????

Thank you for your advise!
Jan



Sat, 21 Jun 2003 19:35:26 GMT  
 Tk::DirTree problems with subdirectories of 'C:' under Win32

Quote:
> Happy new year to all!

> Using DirTree with the option -directory I get the following problem: If I
> use the value 'C:' for this option only the path for the current directory

You must use 'C:/'.  'C:' is just a drive designator and will cause
whatever is the current directory for that drive to be used.

Quote:
> is shown and I don't get all the subdirectories of C:\ . Taking an other
> volume as default directory it works correctly.

> My code:
>    use strict;
>    use Tk;
>    my $mw = MainWindow->new();
>    my $label = $mw->Label(-width=>35);
>    my $dtree = $mw->Scrolled('DirTree', -scrollbars => 'se' ,
>          -height => 25, -width => 35,
>                        -background => 'snow1',
>                        -selectbackground => 'blue4',
>                        -selectforeground => 'snow1',
>          -directory => 'C:',
>                        -browsecmd  => sub {
>                                  my $file = shift;
>                                  $label->configure(-text=>$file);
>                               }
>                        );
> #
>    $dtree->grid(-column => 0, -row => 0, -sticky => 'e');
>    $label->grid(-column => 0, -row => 1, -sticky => 'e');
> #
>    MainLoop;

> The only one way I found to show all the subdirectories of C:\ is to set the
> value of the -directory-option to "" . But this shows a slash on top of the
> tree instead of the directory C:\ .

> What's wrong??????

> Thank you for your advise!
> Jan

--
Marc Dashevsky  (remove "_" from address to reply by e-mail)


Sat, 21 Jun 2003 21:08:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl Tk 'bind' problem

2. Tk::DirTree->see($entryPath) problem

3. Tk::DirTree->see($entryPath) problem

4. open won't open files in subdirectories?

5. Tk::Dirtree/Tk::Dirlist

6. Help needed on Tk::Dirtree or Tk::Dirlist

7. Can't compile Perl/Tk under native Win32 Perl 5.8.0

8. getservbyname('smtp','tcp') Problem

9. Tk::Pretty problem with menu's

10. Win32 Perl and O'Reilly Website problems

11. win32 ftp'put problem with ftp.pl

12. Calling Tk methods from 'C'

 

 
Powered by phpBB® Forum Software