Gtk2::Ex::Email::AddressVBox - Creates a VBox for handling email addresses similar to Claws-Mail.
Version 0.0.1
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;
This initiates the object.
my $avb=Gtk2::Ex::Email::AddressVBox->new();
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');
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}}); }
This creates the VBox that contains the widgets.
This is a array of BCC addresses.
This is a array of CC addresses.
This is a array of To addresses.
my $vbox=$avb->vbox({ to=>['foo@bar'], });
Zane C. Bowers, <vvelox at vvelox.net>
<vvelox at vvelox.net>
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.
bug-gtk2-ex-email-addressvbox at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Gtk2::Ex::Email::AddressVBox
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Gtk2-Ex-Email-AddressVBox
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Gtk2-Ex-Email-AddressVBox
CPAN Ratings
http://cpanratings.perl.org/d/Gtk2-Ex-Email-AddressVBox
Search CPAN
http://search.cpan.org/dist/Gtk2-Ex-Email-AddressVBox/
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.
To install Gtk2::Ex::Email::AddressVBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gtk2::Ex::Email::AddressVBox
CPAN shell
perl -MCPAN -e shell install Gtk2::Ex::Email::AddressVBox
For more information on module installation, please visit the detailed CPAN module installation guide.