home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!utcsri!torn!nott!bnrgate!bgtys9!bnr!tewei
- From: tewei@bnrca (Te-Wei Sun)
- Subject: Scrolling Speed
- Message-ID: <1992Nov6.153802.7682@bnr.ca>
- Keywords: scroll canvas
- Sender: tewei@bnr (Te-Wei Sun)
- Organization: Bell-Northern Research, Ottawa, Ontario, CANADA
- Date: Fri, 6 Nov 92 15:38:02 GMT
- Lines: 65
-
- To all tcl/tk experts:
-
- I have posted a similar article before. However I did not get
- any response. I guess I may have made a mistake on Distribution.
- Therefore I am posting this article again.
-
- I am trying to change the scrolling speed of the arrows and the
- slider of the scroll bar in a canvas. This is rather urgent.
- Any hint, help, information, comment and etc. will be very very
- appreciated.
-
- What I would like to do is the following:
-
- 1. When an arrow is pressed, the scroll speed would increase
- as the time goes. For example, the first one second of scrolling
- the canvas will be scrolling at one unit at a time. The next
- second, the canvas will be scrolling at ten units at a time, and
- so on.
-
- 2. The slider seems to be very sensitive to the mouse movement.
- Therefore it is kind of hard to scroll to the desired position.
- (Things go by too fast. You can hardly tell what they are.)
- I would like to decrease the number of units of scrolling distance
- when the slider detects a mouse movement, (if that is a reasonable
- approach.)
-
- 3. I would like to achieve the above as much in tcl script as
- possible.
-
- I was planing on changing the scrollIncreament value every time
- a Button-Press event on the arrow is detected by using the
- scrollIncreament option in canvas. However, this event seems to be
- detected only once, even though the arrow is still being pressed.
-
- I took a look at tkScrollbar.c and found out most of the mouse events
- are handled in here, which somehow implies I might have to modify
- the code to achieve what I want.
-
- Questions:
-
- 1. Is there a way that I can get the auto-repeat event in tk, such that
- I know the arrow is still being pressed?
- If so, how? (If I can detect this event, maybe I can write a procedure
- to change the scrollIncrement value. Or is there a better approach?)
-
- 2. Is there a way to change the scrolling distance of the slider?
- If so, how?
-
- This question may not apply to my problem, but I am very
- curious about the answer.
-
- 3. When I do a configure on scrollIncrement, I saw two numbers in the
- output. One of them is the scrollIncrement distance. What about
- the other one? Is it adjustable through configure also?
-
- This would be a suggestion for tk3.0.
-
- 4. Wouldn't it be nice to have the scroll bar mouse events been
- bound the way other widgets do, i.e. using 'bind' command in tk?
-
- Again, thanks for any input.
-
- ---------------------------------------------------------------------------
- Te-Wei Sun
- tewei@bnr.ca
-