I'm using Perl/Tk. Excellent! Now the problem. I've got a pair of list boxes that I'd like to scroll together (use one scroll bar to control both list boxes which have the same number of entries). In looking over _Perl in a Nutshell_, I see that one can build up a list box and a single scroll bar (page 577).
$scrollbar = $mw->Scrollbar(-orient => 'vertical');
$listbox = $mw->Listbox (-yscrollcommand => ['set' => $scrollbar]);
$scrollbar->configure(-command => ['yview' => $listbox]);
...pack stuff...
According to the text, this works quite well. Now for the difficult part. Can the Scrollbar's command execute more than one routine? I'd like to do:
$scrollbar->configure(-command => ['yview' => $listboxA, 'yview' => $l
+istboxB]);
and have the callback routine execute TWO routines, one for $listboxA and another for $listboxB. In my searching of the code (Perl/Tk), I can't see if it "walks" the list given for the command to get all of the entries, or just picks the first one and goes from there. The alternative would be to build my own routine that would do the two scrolls, but I was thinking it would be simpler to see if something was already implemented. Thanks for the wisdom!
Update:
Well, I went out and bought (my company did) the book Mastering Perl/Tk. Followed the example and got it to work. The biggest problem was that the original list boxes had horizontal as well as vertical scrolling. I wanted the horizontal scrolling to stay the way it was. In order to do all of this, I needed to build up the individual list boxes in a couple of frames. It turns out that as nice as it might be, if I tried the 'scrolled' method to just get an X scroll bar on the list box, and tried to atach my own Y scroll bar to both of the list boxes it didn't work. I also found out that the 'Scrolled' method allows for a '-title' which the normal list box doesn't (not very clear in the documentation). Everything is worked out, and I built it as:
Frame1 (title)
List_box_1
X_scroll_bar
Frame2 (title)
List_box_1
X_scroll_bar
Y_scroll_bar (links to List_box_1, List_box_2)
Thanks for the help. The pointers were invaluable!