Gtk2::Ex::Email::AttachmentVBox - Creates a VBox for handling attachments.
Version 0.0.1
use Gtk2::Ex::Email::AttachmentVBox; use Gtk2; use Data::Dumper; Gtk2->init; #init it my $avb=Gtk2::Ex::Email::AddressVBox->new(); #get the VBox and add it my $vbox=Gtk2::VBox->new; $vbox->show; my $vbox2=$avb->vbox; $vbox->pack_start($vbox2, 1, 1, 1); #adds a button that calls getFiles my $button=Gtk2::Button->new; $button->show; my $buttonLabel=Gtk2::Label->new('get files'); $buttonLabel->show; $button->add($buttonLabel); $vbox->pack_start($button, 1, 1, 1); $button->signal_connect(activated=>{ my @files=$avb->getFiles; print Dumper(\@files); } ); #add the VBox to the window my $window=Gtk2::Window->new; $window->add($vbox); $window->show; #run it Gtk2->main;
This initiates the object.
my $avb=Gtk2::Ex::Email::AttachmentVBox->new();
This adds a file to the list.
One arguement is required and it is the file to add.
If it fails, it returns undef, otherwise '1'.
my $returned=$avb->addFile($someFile); if(!$returned){ print "Error!\n"; }
This calls Gtk2::FileChooserDialog and the file to the list.
A return of undef means the user canceled. A return of '1' means a file was added.
my $returned=$avb->addFileDialog; if($returned){ print "added a file\n"; }else{ print "user canceled\n"; }
Gets a list of the files that should be attached.
my @files=$avb->getFiles;
This removes the currently selected file from the list.
my $returned=$avb->removeSelected; if($returned){ print "removed\n"; }else{ print "nothing selected\n"; }
This creates the VBox that contains the widgets.
One arguement is taken and it is a array of files to initially attach.
$avb->vbox(\@files);
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-gtk2-ex-email-attachmentvbox at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Gtk2-Ex-Email-AttachmentVBox. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-gtk2-ex-email-attachmentvbox at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Gtk2::Ex::Email::AttachmentVBox
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Gtk2-Ex-Email-AttachmentVBox
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Gtk2-Ex-Email-AttachmentVBox
CPAN Ratings
http://cpanratings.perl.org/d/Gtk2-Ex-Email-AttachmentVBox
Search CPAN
http://search.cpan.org/dist/Gtk2-Ex-Email-AttachmentVBox/
ANDK, #51565, notified be about a missing dependency
Copyright 2011 Zane C. Bowers-Hadley, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Gtk2::Ex::Email::AttachmentVBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gtk2::Ex::Email::AttachmentVBox
CPAN shell
perl -MCPAN -e shell install Gtk2::Ex::Email::AttachmentVBox
For more information on module installation, please visit the detailed CPAN module installation guide.