Why won't my scrolling canvas scroll? 
Author Message
 Why won't my scrolling canvas scroll?

I'm trying to adapt canvas demo #7 from the tk4.2 demos directory to my
needs.  Try though I might, I can't seem to make my canvas scroll.  I've
whittled things down to the following small wish script.  Any
suggestions about what I'm doing wrong would be much appreciated.

------------------------
# adapted from canvas example 7 in the tk 4.2 demos directory
frame .grid

scrollbar .hs -orient horiz -command ".c xview"
scrollbar .vs -command ".c yview"
canvas .c \
    -xscrollcommand ".hs set" \
    -yscrollcommand ".vs set" \
    -scrollregion "-10c -10c 10c 10c"

label .c.l1 -text Label1 -relief raised
place .c.l1 -in .c -x 10 -y 10 -width 75 -height 25

label .c.l2 -text Label2 -relief raised
place .c.l2 -in .c -x 80 -y 30 -width 75 -height 25

grid rowconfig    .grid 0 -weight 1 -minsize 0
grid columnconfig .grid 0 -weight 1 -minsize 0
grid .c -padx 1 -in .grid -pady 1 \
    -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
grid .vs -in .grid -padx 1 -pady 1 \
    -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
grid .hs -in .grid -padx 1 -pady 1 \
    -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news

pack .grid -side top -fill x
-----------------------

Thanks,

--
Skip Montanaro
(replies to "montanaro" at the domain name "crd.ge.com")



Sun, 21 Nov 1999 03:00:00 GMT  
 Why won't my scrolling canvas scroll?

the items you're trying to scroll are "place"d in the
canvas, rather than instantiated as window items.

instead of
    place .c.l1 -in .c -x 10 -y 10 -width 75 -height 25
do
    .c create window 10 10 -window .c.l1 -width 75 -height 25
--



Tue, 23 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. scrolling text widgets inside a scrolling canvas

2. Mouse wheel doesn't scroll text scroll bar

3. Canvas can't scroll _cloned_ controls?

4. CW 2.003 Multi-Line List Box won't scroll

5. List box won't scroll

6. FiledropCombo list won't scroll

7. SCROLL() Won't Work Sideways

8. Scrollbar won't scroll

9. Two canvas scrolled simultaneously by the same scrollbar (an UNIQUE scrollbar and TWO or more canvas)

10. Problem picking canvas objects in scrolled canvas

11. .canvas canvas[x,y] + scrolling -> problems

12. Scrolled Window automatically scrolling

 

 
Powered by phpBB® Forum Software