Renee Baecker > Wx-Perl-DirTree-0.06 > Wx::Perl::DirTree

Download:
Wx-Perl-DirTree-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.06   Source  

NAME ^

Wx::Perl::DirTree - A directory tree widget for wxPerl

DESCRIPTION ^

Many widgets that display directory trees are dialogs or can't handle drives on Windows. This module aims to fill the gap. It can be integrated in any frame or dialog and it handles drives under Windows.

SYNOPSIS ^

  use Wx::Perl::DirTree;
  
  my $panel = Wx::Panel->new;
  my $tree  = Wx::Perl::DirTree->new( $panel, [100,100] );
    
  my $main_sizer   = Wx::BoxSizer->new( wxVERTICAL );
  $main_sizer->Add( $tree->GetTree,  0, wxTOP, 0 );
  
  # in a subroutine
  print $tree->GetSelectedPath;

METHODS ^

GetSelectedPath

  $tree->GetSelectedPath

This method returns the path of the item that is selected.

GetTree

  $tree->GetTree

This is just a convenience method that wraps the GetTree method of Wx::Perl::VirtualTree.

new

Creates a new object

  my $tree  = Wx::Perl::DirTree->new( $panel, [100,100] );
  
  my $tree2  = Wx::Perl::DirTree->new( 
      $panel, 
      [100,100],
      {
          dir => $path_to_dir,
      }
  );
  
  my $tree2  = Wx::Perl::DirTree->new( 
      $panel, 
      [100,100],
      {
          dir     => $path_to_dir,
          is_root => 1,
      }
  );

Parameters:

1 $parent

A parent widget.

2 $size

The size of the tree widget. This has to be an array reference.

3 $hashref

In this hash reference you can specifiy more parameters:

  • dir

    If you want to "open" a specific directory, you can specify "dir"

  • is_root

    If set to a true value, the dir tree starts at the specified directory. If you want to provide a directory tree that shows only the directories below the home directory of a user you can do this:

      Wx::Perl::DirTree->new(
        $panel,
        $size,
        {
            dir => File::HomeDir->my_home,
            is_root => 1,
        }
      );

See also the scripts in the example dir.

AUTHOR ^

Renee Baecker, <module at renee-baecker.de>

BUGS ^

Please report any bugs or feature requests to bug-wx-perl-dirtree at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wx::Perl::DirTree. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Wx::Perl::DirTree

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2008 Renee Baecker, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.