Woodman

Like zentara I am not sure what you want to do either, but for displaying lists or tanbles of data in Tk there are some interesting mega-widgets, and you can make your own should you need to. One that I like is Tk::DBI::Table, just give it some SQL and it displays the data! Like this:

use Tk; use Tk::DBI::Table; my $dbh = createDBconnection(); my $SQL = qq~SELECT * FROM mytable~; my $window = doDBItable( $dbh, $SQL, 'My display window' ); sub doDBItable { my ( $dbh, $SQL, $title ) = @_; 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 => 0, -debug => 0, )->pack( -expand => 1, -fill => 'both' ); debug("-doDBItable"); return $top; } sub createDBconnection { use DBI; my %attr = ( PrintError => 0, RaiseError => 0. ); if ( my $dbh = DBI->connect( 'DBI:mysql:mydatabase', 'username', 'pa +ssword', \%attr ) ) { return ($dbh); } else { print "Cannot open MySQL connection: " . DBI::errstr() . "\n"; return 0; } }
Of course you can look at the code for the module to see how the mega-widget is created. I hope this is of some use, it is a LONG time since I looked at Access (basically 5 years ago when I transitioned my only client who was using it to MySQL).

jdtoronto

Caveat Example taken from working code but not tested, in fact it is guaranteed not to work and has hidden magic that will make your coffee go sour as well!


In reply to Re: repeating Tk widgets for data editing by jdtoronto
in thread repeating Tk widgets for data editing by Woodman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.