smugindividual
Programmer
Whats the trick/option on the canvas widget that will keep it from growing in size when I pack or grid items that will exceed the size. Basically I want a scrolling canvas that stays the size I specify. Its easy with text or listbox widgets, why is canvas giving me problems?
My program is much larger but the following code illustrates my issue.
frame .f -height 5
canvas .f.can -height 5
scrollbar .f.sb -command ".f.can yview"
.f.can configure -yscrollcommand ".f.sb set"
for { set i 0 } { $i < 35 } { incr i } {
for { set j 0 } { $j < 5 } { incr j } {
label .f.can.$i$j -text "$i-$j"
grid .f.can.$i$j -row $i -column $j
}
}
pack .f.can .f.sb -side left -fill y
pack .f
My program is much larger but the following code illustrates my issue.
frame .f -height 5
canvas .f.can -height 5
scrollbar .f.sb -command ".f.can yview"
.f.can configure -yscrollcommand ".f.sb set"
for { set i 0 } { $i < 35 } { incr i } {
for { set j 0 } { $j < 5 } { incr j } {
label .f.can.$i$j -text "$i-$j"
grid .f.can.$i$j -row $i -column $j
}
}
pack .f.can .f.sb -side left -fill y
pack .f