Is it possible using TK to create to text areas with scrollbars that when you scroll one the other moves as well?
What I want to create is a text area with headers in and then text areas underneath row headings in one and data in the other. Kind of Like when you freeze panes in Excel. I have the data in a set of arrays for each line, so all i need is a way of linking the scrollbars in each of the text areas so the up down one in the data also controls the row headings and vice versa, and the left right one of the data controls the column headings and again vice versa.
Probably not possible but doesn't hurt to ask
EDIT
Ok so i have got some code and it almost does what i want but i need some help getting it to work completely. The code example shows that if you move one scrollbar it indeed controls the other text area, and vice versa, but it doesnt control its own text area, is there a way of adding multiple xviews to a command so it moves both textareas at the same time. Thanks in advance
use Tk;
use Tk::ROText;
my @headers = ( "+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| | M | M | M | M | M | M | M | M | M | M | M | M | M | M |",
"| | P | P | P | P | P | P | P | P | P | P | P | P | P | P |",
"| | L | L | L | L | L | L | L | L | L | L | L | L | L | L |",
"| | R | R | R | R | R | R | R | R | R | R | R | R | R | R |",
"| | D | D | D | D | D | D | D | D | D | D | D | D | D | D |",
"| | F | F | F | F | F | F | F | F | F | F | F | F | F | F |",
"| | D | D | D | D | D | D | D | D | D | D | D | D | D | D |",
"| | S | S | S | S | S | E | E | E | E | E | E | B | B | B |",
"| | O | O | O | O | O | V | V | V | V | V | V | A | A | A |",
"| | A | A | A | A | A | F | F | F | F | F | F | Q | Q | Q |",
"| | K | K | K | K | K | B | C | F | G | H | I | A | A | A |",
"| | 1 | 5 | 6 | 7 | 8 | | | | | | | 1 | 2 | 3 |");
my @info = ( "+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHADHRDT | | | | | | | | | | | | | | 1|",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHBAERDT | | 4| | 4| | | | | | | | | | |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHEE1RDT | | | 13| | | | | | 48| | | | | |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHLM2RDT | 96| | | | | | | | | | | | | |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHLSERDT | | | | | | | | | | | | | 7| |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHLW1RDT | | | | | | | | | | | 9304| | | |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+",
"| LHUP1RDT | | | | | 160|84385| | | | 271| | | | |",
"+----------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+");
my $mw = MainWindow->new ( -background => "GREY" );
$mw->title("What Gap Issues There Have Been");
$mw->resizable(0, 0);
$mw->focus;
$mw->geometry("600x400");
my $TA1F = $mw->Frame(-width=>5,-height=>5,-foreground=>"BLUE",-background=>"GREY",-borderwidth=>2,-relief=>'groove')->place(-x=>5,-y=>5);
my $TA1 = $TA1F->Scrolled( 'ROText', -scrollbars => 'se', -height => 10)->pack(-side => 'left');
$TA1->configure(-background => "GREY",-wrap=>"none");
$TA1->insert('end', "$_\n") foreach @headers;
my $TA2F = $mw->Frame(-width=>5,-height=>5,-foreground=>"BLUE",-background=>"GREY",-borderwidth=>2,-relief=>'groove')->place(-x=>5,-y=>200);
my $TA2 = $TA2F->Scrolled( 'ROText', -scrollbars => 'se', -height => 10)->pack(-side => 'left');
$TA2->configure(-background => "GREY",-wrap=>"none");
$TA2->insert('end', "$_\n") foreach @info;
$TA1->Subwidget("xscrollbar")->configure(-command => ['xview', $TA2]);
$TA2->Subwidget("xscrollbar")->configure(-command => ['xview', $TA1]);
$mw->focus;
MainLoop;
exit 0;