Gtk2::Ex::Datasheet::DBI
Gtk2-Ex-Datasheet-DBI is the datasheet module from the Axis project. It automates the setup of Gtk2’s treeview widget and associated cell renderers, which allows you to view and edit data in a grid layout.
Database Compatibility
- MySQL
- Postgres
- Microsoft SQL Server ( via DBD::ODBC )
- SQLite
Adding support for other databases with a Perl DBI driver should be trivial.
Cell Renderer Support
- Text
- Combo
- Dynamic Combo
- Date
- Time
- Toggle
- Hidden
- Progress ( display only )
Where possible, Gtk2::Ex::Datasheet::DBI will automatically set up an appropriate cell renderer, based on the column type detected on the database server.
Both combo renderers support an arbitrary number of columns, including the most common ID / String column pairs. The Dynamic Combo can be set up to automatically change the list of available options in a combo based on data in the current row.
Adaptive layout column widths
Each column can be defined with a fixed-width or a relative width. All relative-width columns automatically resize when you resize their parent window.
Callbacks
You can attach your own code to common events such as on_current and on_apply, ( amongst others ), making it easy to catch these events no matter where they’re triggered from.
Intelligent Record Management
Gtk2::Ex::Datasheet::DBI was designed to send updates in a datasheet back to the database server in a batch. This was done to minimise network usage, as I was developing with remote data entry in mind. It also means you can undo data entry in a batch.
The first column in each datasheet contains a status indicator rendered with the current Gtk2 theme. You can also programatically fetch the status of each row by checking the value in this column.
Cell-based data validation
You can define data validation functions on each column, which means you can reject bad data as it’s being entered, with a nice dialog box describing the issue to the user.
Built-in Calculator
Users can trigger a simple calculator from any managed entry widget, from a context-sensitive menu ( or you can trigger it from code ). This is great for data entry scenarios where users have to add up lots of figures and copy the total into a field.

