RFC:: Gtk2::Ex::Linker

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I wrote a simple module to link a database content to a Gtk2 window, and I  
thought that a suitable name would be


and I'm planning to upload it on CPAN.  

Here's the rationale:


       Gtk2::Ex::Linker - Use sql or an object-relational mapper to get dat
a from a database and build a gtk2 Gui using a glade file


 use My::Form;
 use Rdb::MyTable::Manager;
 use Gtk2::Ex::Linker::RdbDataManager
 use Gtk2 -init;
 use Gtk2::GladeXML;

        my $builder = Gtk2::Builder->new();

        my $data = Rdb::MyTable::Manager->get_coll(query => [primary_ke
y => {eq => $self->}]);
        my $dman = Gtk2::Ex::Linker::RdbDataManager->new({data=> $data,
 meta => Rdb::MyTable->meta });

        $self-> = Gtk2::Ex::Linker::Form->new({
                data_manager => $dman,
                builder =>      $builder,


The aim of this module is to automate the process of tying data from a data
base to widgets on a Glade-generated window.  
All that is required is that you name your widgets the same as the fields i
n your data source.
Step for use:

1) Instanciate a xxxDataManager object that access the database and contain
s the rows to display to the Form or Datasheet modules.  
    Currently there are three way to access the database: plain sql + DBI, Ros
e::DB::Object, and DBIx::Class  

2) Instanciate a Gtk2::GladeXML object  
3) Instanciate a Gtk2::Ex::Linker::Form object or a Gtk2::EX::Linker::Datas
heet that displays the data from the DataManager using the glade file.

You would then typically connect the buttons to the methods below to handle
 common actions such as inserting, moving, deleting, etc.

This module is the same as Gtk2::Ex::DBI and Gtk2::Ex::Datasheet::DBI excep
t that database access can be made using plain SQL or the ORM mentioned abo
Other ORM could be added if needed. The developer of Gtk2::Ex::DBI is not i
nterested + has no time + no need for including these change in the origina
l modules unfortunately.

 I'm kindly asking for comments/suggestions/impressions about this idea and
 the namespace.


Site Timeline