Scrollbars and jump
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Scrollbars and jump

From: Tomas Lundberg <Tomas.LundbergNO@SPAMericssonPLEASE.com>
Date: Wed Dec 28 2005 - 16:11:41 CET

Hi all,

I'm trying to create a scrollbar with the "jump" behaviour (i.e. where
the update is not done continuously, but rather in one single step when
the mouse button is released). The following script (adapted from the
scrollbar Wiki page) works on Linux using Tcl/Tk 8.4.6 but not (in the
sense that the scrolling is continuous) on Windows, neither with 8.4.10
nor 8.4.12 (ActiveState's distributions):

8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------
text .xstdin -yscrollcommand {.s set}

for { set i 1 } { $i <= 100 } { incr i 1 } {
    .xstdin insert end "Line $i\n"
}

scrollbar .s -orient vertical -jump 1 -command {.xstdin yview}
button .b1 -text Exit -command exit

pack .b1 -side bottom

pack .s -side right -fill y

pack .xstdin -expand yes -fill both
8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------

Am I doing something wrong? Or doesn't "scrollbar jumps" work on
Windows (I guess "scrollbar" uses native scrollbars)?

Regards,
        Tomas

-- 
Tomas Lundberg   |  The most exciting phrase to hear in science, the
Ericsson AB      |  one that heralds new discoveries, is not `Heureka!'
Luleå            |  but `That's funny...'
Sweden           |                                Isaac Asimov
Received on Tue Jan 3 03:09:26 2006