Multi listbox, one scrollbar 
Author Message
 Multi listbox, one scrollbar

Is there a clever way to slave multiple listboxes to one scrollbar?
I'm using tk4p3.  TIA!
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

        CK6! INC * P.O. Box 2269, Ramona, CA. 92065 * (619) 789-8106
                      http://www.*-*-*.com/ ~ck6inc/


Thu, 25 Jun 1998 03:00:00 GMT  
 Multi listbox, one scrollbar

Quote:

>Is there a clever way to slave multiple listboxes to one scrollbar?
>I'm using tk4p3.  TIA!

As noone seemed to answer your message yet, here's one I posted before as
an example:

proc LBset args {
        foreach lb {.1 .2 .3} {
                eval $lb $args
        }

Quote:
}

proc LBscroll args {
        eval .sy set $args
        LBset yview moveto [lindex $args 0]

Quote:
}

listbox .1 -export no -selectmode browse -yscrollcom LBscroll
listbox .2 -export no -selectmode browse -yscrollcom LBscroll
listbox .3 -export no -selectmode browse -yscrollcom LBscroll
pack .1 .2 .3 -side left -fill both -expand 1

scrollbar .sy -orient v -command "LBset yview"
pack .sy -fill y -side right

for {set i 25} {$i} {incr i -1} {LBset insert end $i}

foreach lb {.1 .2 .3} {
        bind $lb <ButtonPress-1> {
                LBset select clear 0 end
                LBset select set [%W nearest %y]
        }
        bind $lb <B1-Motion> {
                LBset select clear 0 end
                LBset select set [%W nearest %y]
        }
        bind $lb <ButtonRelease-1> {
                LBset select clear 0 end
                LBset select set [%W nearest %y]
        }

Quote:
}

--
     Jeffrey Hobbs                           Office: 541/346-3998

                URL: http://www.cs.uoregon.edu/~jhobbs/


Sat, 04 Jul 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Join several listboxes to one scrollbar...

2. One Scrollbar for two listboxes??

3. one scrollbar for two listboxes?

4. one scrollbar for two listboxes?

5. Scrolling two listboxes with one scrollbar?

6. Multiple listbox control with one scrollbar

7. 2 or more listboxes listening to one scrollbar ?

8. Two listboxes, one vert scrollbar

9. one scrollbar for more than one widget

10. More than one listbox on one file in same window

11. How can I control a ListBox scrollbar?

12. Vertical scrollbar in listbox

 

 
Powered by phpBB® Forum Software