Wx::Perl::BrowseButton - a file/directory browse control
use Wx::Perl::BrowseButton qw(:everything); my $browse = Wx::Perl::BrowseButton->new ( $parent, $id, '/home/mbarbon', $position, $size, wxPL_BROWSE_FILE, $validator ); $browse->SetPath( 'C:\\Program Files' ); my $path = $browse->GetPath EVT_PL_BROWSE_PATH_CHANGED( $handler, $browse->GetId, sub { my( $self, $event ) = @_; print 'New path: ', $event->GetPath; };
This simple control displays a text input field asociated with a browse button. The user can either type the path inside the text field or click the browse button to open a file/directory browser.
The control sends a 'path changed' event when either the path is set using the browse dialog or the control loses focus after the contents of the input field have been changed using the keyboard.
browse for a directory
Called when the path is changed using the browse button or the path is typed directly in the input field and the field loses focus.
my $browse = Wx::Perl::BrowseButton->new ( $parent, $id, $initial_path, $position, $size, $style, $validator );
Creates a new browse button.
my $path = $browse->GetPath;
Returns the path currently displayed in the input field.
$browse->SetPath( $path );
Sets the path displayed in the input field. It does not send a 'path changed' event.
Mattia Barbon <mbarbon@cpan.org>
Copyright (c) 2005 Mattia Barbon <mbarbon@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself
To install Wx::Perl::BrowseButton, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx::Perl::BrowseButton
CPAN shell
perl -MCPAN -e shell install Wx::Perl::BrowseButton
For more information on module installation, please visit the detailed CPAN module installation guide.