> From: Gisle Aas [mailto:gi...@activestate.com]
> Right. The attached patch does exactly that. It allows this > program to work as expected: very nice. > ---------------- > use strict; > use warnings; > use Tkx; > > Tkx::package_require("Tktable"); > > my $mw = Tkx::widget->new("."); > my %hash = ( # data to display > '0,0' => 'Goodby', > '1,1' => 'cruel', > '2,2' => 'world', > ); > > my $t = $mw->new_table( > -rows => 5, > -cols => 3, > -cache => 1, > -variable => \%hash, > ); > $t->g_pack(-fill => 'both', -expand => 1); > Tkx::MainLoop(); > use Data::Dump; dd \%hash; > ---------------- > > One uglyness is that the hash is copied the first time it's > passed to a Tcl function in this way. I wonder if it would As far as I understand, you're copying to allow 'tie'. Am I correct that you think of it as 'ugly' because of cases when there will be large amount of data to copy? > be possible to set up some arrangement with tracing on the > Tcl side that calls back into Perl so that we can actually > keep that hash on the Perl side; thus avoiding the copy. Too > complicated? I see no big reason for the hash to be on Perl side. At least current implementation looks to me consistent with other Perl 'tie's, and also with current Tcl bindings. Maybe having hashes and arrays on Perl side with Tcl communicating to them could be sometimes useful, but I haven't faced this necessity yet. Best regards, Vadim.