Tk::DBI::Table - Megawidget to display a sql-Statement in HList.
use Tk; use Tk::DBI::Table; my $top = MainWindow->new; my $tkdbi = $top->DBITable( -sql => 'select * from table', -dbh => $dbh, -display_id => 0, )->pack(expand => 1, -fill => 'both'); MainLoop;
This is a megawidget that enables you to display sql statements from a database. The features are:
A database handle, this will return a error if not defined.
A sql statement, this will return an error if not defined.
This is a switch that turns on debug output to the normal console (STDOUT).
This is a switch for displaying the index column.
Default field column width.
Maximum displaying chars in the cells. Global or only in named columns.
Maximum columns in this table, this replace the count of fields in sql-statment.
Column sort style.
These are the methods you can use with this Widget.
Set a new SQL-Statement and will display this.
This is a wrapper to the HList Method ->info. The default method is info('data', ...). Please read the manual from Tk::HList.
Refresh the table and sort (optional) the col number.
Refresh the table and sort the col number or return the actually col sort number.
Set a new sorting direction. no parameter will return the actual sort direction.
This is a normal HList widget. I.e.:
$dbitable->Subwidget('table')->configure( -command = sub{ printf "This is id: %s\n", $_[0] }, };
This is a (Resize)Button widget. This displays a Compound image with text and image.
$Log: Table.pm,v $ Revision 1.13 2003/11/06 17:55:52 xpix ! bugfixes in refresh_id * not hudge load for tree
Revision 1.11 2003/07/17 14:59:53 xpix ! many little bugfixes
Revision 1.8 2003/04/29 16:25:58 xpix * reformat
Revision 1.6 2003/04/29 16:22:52 xpix * chnages tag
xpix@netzwert.ag
Copyright (C) 2003 , Frank (xpix) Herrmann. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Tk::DBI::*, Tk::ResizeButton, Tk::HList
To install Tk::DBI::Form, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::DBI::Form
CPAN shell
perl -MCPAN -e shell install Tk::DBI::Form
For more information on module installation, please visit the detailed CPAN module installation guide.