# Using the supplied SQL display a table view of the data. sub doDBItable { my ( $dbh, $SQL, $title ) = @_; debug("+doDBItable"); debug("SQL : $SQL"); if ( not defined $title ) { $title = "List Preview" } my $top = MainWindow->new( -title => $title ); $top->geometry("600x400+50+50"); my $tkdbi = $top->DBITable( -sql => $SQL, -dbh => $dbh, -display_id => 1, -debug => 0, )->pack( -expand => 1, -fill => 'both' ); $tkdbi->Subwidget('table')->configure( -selectmode => 'single', -command => \&procSelected, -browsecmd => sub{ printf "This is id: %s\n", $_[0] }, ); debug("-doDBItable"); return $top; } sub procSelected { printf "Process record %s\n", $_[0]; }