Synonym of [scroll]ing, at least in some communities. Some people find the term "panning" completely unfamiliar and would use "scrolling" instead, whereas others seem to consider the two as distinct. Explanation given in [Canvas slowdowns]: [lv] What is [panning]? [AM] Panning is the process whereby the whole picture is shifted - you get a different viewing rectangle. With zooming you enlarge the drawn objects, with panning you move them around. One way to do it (from the user's point of view) is to keep the mouse button down and move it around. The "map" underneath then shifts with the mouse pointer. [LV] Thanks! I see people mention this word but never knew how to actually try to do what they were describing. ---- [[Yikes! [CL] thought we had an example implementation here, and now feels some obligation to supply one, if it doesn't soon turn up on its own.]] [slebetman]: Here's one I use to enable panning of the [canvas]. I'm sure I got the code somewhere from this wiki but can't remember where exactly. This illustrates the basic idea: proc pan {widget x y prev_xy} { global $prev_xy set xx [lindex [set $prev_xy] 0] set yy [lindex [set $prev_xy] 1] $widget move all [expr {$x-$xx}] [expr {$y-$yy}] set $prev_xy [list $x $y] } To use it just bind it to . Here's an example of how to bind it: # Create a test canvas: pack [canvas .c -bg white] -fill both -expand 1 proc randrect {} { set x1 [expr {rand()*600}] set y1 [expr {rand()*600}] set x2 [expr {rand()*60+$x1}] set y2 [expr {rand()*60+$y1}] return [list $x1 $y1 $x2 $y2] } foreach - [string repeat ". " 200] { .c create rect [randrect] -fill grey } # Enable panning. You need one global variable to # "remember" the previous xy coordinate: set xy {0 0} bind .c { set xy {%x %y} bind .c {pan .c %%x %%y xy} } bind .c { bind .c {} } To '''pan''', simply click the canvas and move the mouse around. As you can see, [panning] and scrolling does the same thing but ''feels'' different. Typically, for browsing graphical data, panning is much more intuitive and much faster. Of course, the above code simply illustrates the basic concept. It is tedious to bind the pan function to the canvas this way. Here's a simple wrapper function to ease the pain: proc enable_panning {widget prev_xy} { global $prev_xy bind $widget [subst -nocommands { set $prev_xy {%x %y} bind $widget {pan $widget %%x %%y $prev_xy} }] bind $widget [subst -nocommands { bind $widget {} }] } # To use it simply pass the canvas name and global variable: enable_panning .c xy [Alastair Davies] thinks the canvas has more or less built-in support for panning. (In other words, the global variables required by the above method, can actually be handled by the canvas itself, using the '''mark''' and '''scan''' subcommands.) The following two bindings invoke it: bind $c { %W scan mark %x %y } bind $c { %W scan dragto %x %y 1 } ---- [[ [Category Glossary] | [Category GUI] ]]