Gtk2::Ex::DBI 2.0 review

Download
by rbytes.net on

License: Perl Artistic License
File size: 28K
Developer: Daniel Kasak
0 stars award from rbytes.net

Gtk2::Ex::DBI - Bind a Gtk2::GladeXML can generated window to a DBI data source.

SYNOPSIS

use DBI; use Gtk2 -init; use Gtk2::GladeXML; use Gtk2::Ex::DBI;
my $dbh = DBI->connect ( "dbi:mysql:dbname=sales;host=screamer;port=3306", "some_username", "salespass", { PrintError => 0, RaiseError => 0, AutoCommit => 1, } );
my $prospects_form = Gtk2::GladeXML->new("/path/to/glade/file/my_form.glade", 'Prospects');
my $data_handler = Gtk2::Ex::DBI->new( { dbh => $dbh, schema => "sales", sql => { select => "*", from => "Prospects", where => "Actve=? and Employees>?", where_values => [ 1, 200 ], order_by => "ClientName", }, form => $prospects, formname => "Prospects", on_current => &Prospects_current, calc_fields => { calc_total => 'eval { $self->{form}->get_widget("value_1")->get_text + $self->{form}->get_widget("value_2")->get_text }' }, default_values => { ContractYears => 5, Fee => 2000 } } );
sub Prospects_current {
# I get called when moving from one record to another ( see on_current key, above )
}

Requirements:
Perl

Gtk2::Ex::DBI 2.0 search tags