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!

In reply to Double Callbacks? by herby1620

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.