Re: help image scrolling



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.



--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Re: [FreeBSD] Makefile broken
    ... Das hat mit dem Package Management nun gar nichts zu tun. ... dpkg oder rpm die Pakete ins System kippt, sieht man nur in dem Moment, ... Nimm mal beispielsweise Software, die auf TCL/TK basiert. ...
    (de.comp.os.unix.bsd)
  • Re: Write my own library/extension or create package that calls external program?
    ... some extensions that expose parts of the Mac OS X API not currently ... Tcl/Tk, etc. ... and then bundle that as a Tcl package? ... How about the dependencies' own dependencies? ...
    (comp.lang.tcl)
  • Re: ANNOUNCE: Geek (package based compiler/loader/wrap), release 0.1
    ... Geek is trying to provide a framework to help developer use tcl/tk to ... It can wrap a tcl/tk program to .EXE in ... compile tcl/tk code to TCL ByteCode and the package ... Does the compiler generate standard Tcl Bytecode loaded via the bload command or is this some representation of your own? ...
    (comp.lang.tcl)
  • ANNOUNCE: Geek (package based compiler/loader/wrap), release 0.1
    ... Geek is trying to provide a framework to help developer use tcl/tk to ... It can wrap a tcl/tk program to .EXE in ... compile tcl/tk code to TCL ByteCode and the package ... Geek is hosted under the geetk project at SourceForge: ...
    (comp.lang.tcl)
  • ANNOUNCE: Geek (package based compiler/loader/wrap), release 0.1
    ... Geek is trying to provide a framework to help developer use tcl/tk to ... It can wrap a tcl/tk program to .EXE in ... compile tcl/tk code to TCL ByteCode and the package ... Geek is hosted under the geetk project at SourceForge: ...
    (comp.lang.tcl)