App-Wx-PodEditor

 view release on metacpan or  search on metacpan

lib/App/Wx/PodEditor/Actions/File.pm  view on Meta::CPAN

package App::Wx::PodEditor::Actions::File;

use strict;
use warnings;

use Wx qw(
    wxRICHTEXT_TYPE_XML
);
use Exporter;
use FileHandle;
use File::Temp;

our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
    file_OpenFile
    file_SaveFile
);
our %EXPORT_TAGS = (
    all => [@EXPORT_OK],
);

our $VERSION = 0.01;

sub file_OpenFile {
    my ($self,$event) = @_;
    
    my $file = Wx::FileSelector( 'Open a Pod file', '', '', 'Pod file (*.pod) | *.pod' );
    if( $file ){
        my $content = do{ local (@ARGV,$/) = $file; <> };
        $self->_editor->set_pod( $content );
    }
}

sub file_SaveFile {
    my ($self,$event) = @_;
    
    print "save file...\n";
    my $pod = $self->_editor->get_pod;
    
    print $pod,"\n";
}

sub file_SaveFileAs {
    my ($self,$event) = @_;
    
    print "save file as...\n";
}

sub file_NewFile {
    my ($self,$event) = @_;
    
    $self->_editor->SetText("");
}

1;

=pod

=cut

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.396 second using v1.00-cache-2.02-grep-82fe00e-cpan-72ae3ad1e6da )