Re: help image scrolling



Hello Gerald
thank you for the code, it works perfectly. On the other
hand i will study this working code since i am just
starting to handle canvas.
Thank you again
jerome
On Sat, 29 Apr 2006 18:15:30 -0500, "Gerald W. Lester"
<Gerald.Lester@xxxxxxx> wrote:

suchodj@xxxxxxxxxx wrote:
Hello Aric
i downloaded Tcl/Tk 8.5a4 from http://www.equi4.com/pub/tk/8.5a4/.
As you said it works fine. Since it has not the package "Img" i had
to convert my picture from "jpg" to "gif". Many thanks.
One more question please :
supposing there is no Tcl/Tk 8.5.x and i have only Tcl/Tk 8.4.x
how can i visualize pictures and scroll them horizontal and vertical ?
thanks in advance

Prior to 8.5, text widgets minimum scrolling was a line at a time.

Try a canvas widget instead, as in:

package require image

scrollbar .hsb -orient horizontal -command [list .c xview]
scrollbar .vsb -orient vertical -command [list .c yview]
canvas .c \
-xscrollcommand [list .hsb set] \
-yscrollcommand [list .vsb set]
grid .c -row 1 -column 1 -sticky nsew
grid .vsb -row 1 -column 2 -sticky ns
grid .hsb -row 2 -column 1 -sticky ew
grid columnconfigure . 1 -weight 1
grid rowconfigure . 1 -weight 1

set im [image create photo im -file {04.jpg}

.c create image 0 0 -image im
.c configure -scrollregion [.c bbox all]

jerome



On 29 Apr 2006 13:21:05 -0700, "Aric Bills" <aric.bills@xxxxxxxxx>
wrote:

Scrolling has been enhanced in Tk 8.5. If you use the ActiveTcl 8.5
beta, an 8.5 tclkit, or some other incarnation of Tcl 8.5, your code
should work okay.


.



Relevant Pages

  • Re: help image scrolling
    ... canvas your code will help me practicing it. ... i downloaded Tcl/Tk 8.5a4 from http://www.equi4.com/pub/tk/8.5a4/. ... text widgets minimum scrolling was a line at a time. ... -yscrollcommand [list .vsb set] ...
    (comp.lang.tcl)
  • Re: How do I determine the screen size in Tk ?
    ... Mark Hobley wrote: ... > I am new user of Tcl/Tk. ... > How do I determine the maximum size of canvas that I can use within my ... > The resultant window was larger than the screen due to the border, ...
    (comp.lang.tcl)
  • Trouble understanding the binding...
    ... I am trying to relearn a bit of Tcl/Tk. ... of embedding a potentially large widget in a "scrolling" canvas. ... a frame containing all of the widgets into the northwest corner of the ... proc adjustFrame { ...
    (comp.lang.tcl)
  • How do I determine the screen size in Tk ?
    ... How do I determine the maximum size of canvas that I can use within my Tcl/Tk ... The resultant window was larger than the screen due to the border, ... 393 Quinton Road West ...
    (comp.lang.tcl)