NAME

Gtk2::Ex::Email::AttachmentVBox - Creates a VBox for handling attachments.

VERSION

Version 0.0.1

SYNOPSIS

    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;

METHODS

new

This initiates the object.

my $avb=Gtk2::Ex::Email::AttachmentVBox->new();

addFile

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";
}

addFileDialog

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";
}

getFiles

Gets a list of the files that should be attached.

my @files=$avb->getFiles;

removeSelected

This removes the currently selected file from the list.

my $returned=$avb->removeSelected;
if($returned){
    print "removed\n";
}else{
    print "nothing selected\n";
}

vbox

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);

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

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.

SUPPORT

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

perldoc Gtk2::Ex::Email::AttachmentVBox

You can also look for information at:

ACKNOWLEDGEMENTS

ANDK, #51565, notified be about a missing dependency

COPYRIGHT & LICENSE

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.