If I am the author of Tk::DBI::From, I will seperate data and presentation classes, and make sure the presentation class provides a common interface towards data classes. If I only have the time to implement interface to MySQL, as least other people can easily add their data classes for other databases, according to the open interface I defined. Unfortunately that module was developed in a closed structure.

You said that you have the database portion implemented already, and is seeking for Tk GUI part. I think Tk::Table meets the general requirement of rendering database table pretty well. I made up some demo:

use Tk; use Tk::Table; use Data::Dumper; use strict; my ($row, $col); #data, in your case, come from database my @cell_vars; foreach $row (0 .. 9) { my @row_vars; foreach $col (0 .. 9) { push @row_vars, $row * $col; } push @cell_vars, \@row_vars; } #presentation my $mw = MainWindow->new; $mw->geometry("600x250"); my $table = $mw->Table(-rows => 9, -columns => 9, -scrollbars => "se", -fixedrows => 1, -fixedcolumns => 1, -takefocus => 1)->pack; foreach $col (1 .. 9) { my $col_header = $mw->Button(-text => "Column " . $col); $table->put(0, $col, $col_header); } foreach $row (1 .. 9) { my $row_header = $mw->Button(-text => "Row " . $row); $table->put($row, 0, $row_header); foreach $col (1 .. 9) { my $cell = $mw->Entry(-width => 10, -textvariable => \$cell_va +rs[$row][$col]); $table->put($row, $col, $cell); } } #manipulate data $cell_vars[5][6] = "foo"; MainLoop;

As you can see, it is very easy to set/get the cell values, and modification to data is automatically reflected on screen (you don't need to do anything). If you only want to display data, but not editing, replace Entry with Label.

Good Luck!


In reply to Re: Perl::TK Class::DBI Oracle by pg
in thread Perl::TK Class::DBI Oracle by set_uk

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.