NAME

Gtk2::Ex::Email::AddressVBox - Creates a VBox for handling email addresses similar to Claws-Mail.

VERSION

Version 0.0.1

SYNOPSIS

    use Gtk2::Ex::Email::AddressVBox;
    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 getAddresses
    my $button=Gtk2::Button->new;
    $button->show;
    my $buttonLabel=Gtk2::Label->new('get addresses');
    $buttonLabel->show;
    $button->add($buttonLabel);
    $vbox->pack_start($button, 1, 1, 1);
    $button->signal_connect(activated=>{
	    								my %addresses=$avb->getAddresses;
		    							print Dumper(\%addresses);
			    						}
				    		);
    
    #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::AddressVBox->new();

addHB

This adds a new HBox to the VBox. The HBox contains the stuff for a single address.

Two option arguements are taken the first is the type to add and the second is the address.

#adds a new blank one
$avd->addHB();

#adds a new blank To one
$avd->addHB('to');

#adds a new blank CC one
$avd->addHB('cc');

#adds a new blank BCC one
$avd->addHB('bcc');

#adds a new blank To one set to foo@bar
$avd->addHB('to', 'foo@bar');

getAddresses

This gets the the addresses users have entered. Any that match '' or /^ *$/ will be ignored.

my %addresses=$avb->getAddresses;
if(defined($addresses{to})){
    print 'To: '.join(' ', @{$addresses{to}});
}
if(defined($addresses{cc})){
    print 'CC: '.join(' ', @{$addresses{cc}});
}
if(defined($addresses{bcc})){
    print 'BCC: '.join(' ', @{$addresses{bcc}});
}

vbox

This creates the VBox that contains the widgets.

args hash

bcc

This is a array of BCC addresses.

cc

This is a array of CC addresses.

to

This is a array of To addresses.

my $vbox=$avb->vbox({
                     to=>['foo@bar'],
                    });

AUTHOR

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

BUGS

Please report any bugs or feature requests to bug-gtk2-ex-email-addressvbox at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Gtk2-Ex-Email-AddressVBox. 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::AddressVBox

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009 Zane C. Bowers, all rights reserved.

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