Tkx and Tkx::Tutorial and http://www.tkdocs.com/tutorial/onepage.html and http://docs.activestate.com/activetcl/8.5/tktable/tkTable.html is all there is specific to Tkx, the rest is Tcl specific, or perl/Tk specific
If you grasp the Tkx specifics, you can make use of perl Tk help, RFC: Learning Perl/Tk, Perl/Tk: For Beginners, Re^3: Tkx Search for dialog box for text input , Re: TclTk interface with Perl code, is it possible? , Re^2: GUI toolkit+designer for the perl newbie , Re: Easier GUI, Re: Should I use Perl/TK?, Re^2: need a popup gui stdin, Tk Tree Tutorial ( http://www.rtapo.com/tutorials/tk_tree.html ), some Tkx tutorial links, Tutorial http://theoryx5.uwinnipeg.ca/perltk/ and http://www.perl.com/pub/1999/10/perltk/, http://perltk.org/, http://web.archive.org/web/20100310202528/http://theoryx5.uwinnipeg.ca/perltk/, How to RTFM Tk Tutorials
and/or maybe you can give a more detailed comments considering the situation above
No thanks, the code is too short and you're not being specific
#!/usr/bin/perl --
use strict;
use warnings;
use Data::Dump qw/ dd pp /;
$Tkx::TRACE = 64;
use Tkx;
Main( @ARGV );
exit( 0 );
sub Main {
Tkx::package_require("Tktable");
my $mw = Tkx::widget->new(".");
my %tablecontents ;
my $table = $mw->new_table(
-rows => 4,
-cols => 4,
-cache => 1,
-variable => \%tablecontents,
);
$table->g_pack( -fill => 'both', -expand => 1 );
my $popb = $mw->new_button( -text => 'Populate' );
$popb->configure(
-command => [ \&populate_table, $table , \%tablecontents ],
);
$popb->g_pack;
$mw->new_button(
-text=>"Finish",
-command=> [ \&record_data_exit , $mw, $table, \%tablecontents
+ ],
)->g_pack();
Tkx::MainLoop();
}
sub populate_table {
my( $table, $hash ) = @_;
dd[ $hash ];
my $rows = $table->cget('-rows') ;
my $cols = $table->cget('-cols') ;
for my $row ( 0 .. $rows ){
for my $col ( 0 .. $cols ){
$table->set("$row,$col", "yo $row, $col oy" );
}
}
dd[ $hash ];
return;
}
sub record_data_exit {
my( $mw, $table, $hash ) = @_;
dd[ $table->get( qw/ topleft bottomright / ) ];
my $rows = $table->cget('-rows') ;
my $cols = $table->cget('-cols') ;
for my $row ( 0 .. $rows ){
for my $col ( 0 .. $cols ){
dd[ $table->get( "$row,$col" ) ];
}
}
dd[ $hash ];
$mw->g_destroy;
};
|