one scrollbar for more than one widget 
Author Message
 one scrollbar for more than one widget

Hi,

my problem is, that i need a window with two graficcanvas in it.
these two windows should be scrolled by one scrollbar in x-direction.
one window should only be scrolled in y-direction.

HELP

thanks a lot
--

--

  Diplomand am Lehrstuhl fuer Kommunikationsnetze, TU Muenchen
  Tel.   (Uni) +49 89 28923513           (home) +49 89 1785206
-----------------------------------------------------------------------



Mon, 09 Aug 1999 03:00:00 GMT  
 one scrollbar for more than one widget

Quote:

> Hi,

> my problem is, that i need a window with two graficcanvas in it.
> these two windows should be scrolled by one scrollbar in x-direction.
> one window should only be scrolled in y-direction.

Here's one way of doing it using a procedure ScrollTwoCanvasX for the
-command option for your horizontal scrollbar :

    # frame for canvas and ruler
    set canvasfr [frame .frame ]
    # canvas ruler
    set canvasruler [canvas $canvasfr.canvasruler \
            -xscrollcommand  [list $canvasfr.xscroll set]]

    # canvas for the view
    set canvas [canvas $canvasfr.canvas  \
            -xscrollcommand \
            [list $canvasfr.xscroll set] -yscrollcommand \
            [list $canvasfr.yscroll set]]

    # set up scrollbars
    # horizontal scrollbar is specially set up to scroll the canvas
    # and the canvas ruler by using ScrollTwoCanvasX method
    set hscroll [scrollbar $canvasfr.xscroll -orient horizontal \
            -command \
            "ScrollTwoCanvasX $canvasfr.canvas $canvasfr.canvasruler"]
    set vscroll [scrollbar $canvasfr.yscroll -orient vertical -command \
            [list $canvasfr.canvas yview]]

# special procedure to set up horizontal scrolling of two canvases
# with one horiz scroll bar
#
proc ScrollTwoCanvasX { canvas1 canvas2 args } {

    eval $canvas1 xview $args
    eval $canvas2 xview $args

Quote:
}

--

Mentor Graphics Corporation
Warren, NJ


Tue, 10 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Two canvases (widgets), one scrollbar..

2. Scrolling two different widgets will one scrollbar

3. How to use one scrollbar to control two text widgets

4. One scrollbar for mutiple widgets ?

5. One Scrollbar, Multilpe Text/Canvas Widgets

6. Synchronizing two text- widgets to one scrollbar ?

7. controlling two texts widgets with one scrollbar

8. How to replace one or two words with one word with one line of awk code

9. See one, do one, teach one...

10. Join several listboxes to one scrollbar...

11. One Scrollbar for two listboxes??

12. one scrollbar for two listboxes?

 

 
Powered by phpBB® Forum Software