home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / tcl / 1750 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.8 KB  |  77 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!utcsri!torn!nott!bnrgate!bgtys9!bnr!tewei
  3. From: tewei@bnrca (Te-Wei Sun)
  4. Subject: Scrolling Speed
  5. Message-ID: <1992Nov6.153802.7682@bnr.ca>
  6. Keywords: scroll canvas
  7. Sender: tewei@bnr (Te-Wei Sun)
  8. Organization: Bell-Northern Research, Ottawa, Ontario, CANADA
  9. Date: Fri, 6 Nov 92 15:38:02 GMT
  10. Lines: 65
  11.  
  12. To all tcl/tk experts:
  13.  
  14. I have posted a similar article before. However I did not get
  15. any response. I guess I may have made a mistake on Distribution.
  16. Therefore I am posting this article again.
  17.  
  18. I am trying to change the scrolling speed of the arrows and the
  19. slider of the scroll bar in a canvas. This is rather urgent.
  20. Any hint, help, information, comment and etc. will be very very
  21. appreciated.
  22.  
  23. What I would like to do is the following:
  24.  
  25. 1. When an arrow is pressed, the scroll speed would increase
  26. as the time goes. For example, the first one second of scrolling
  27. the canvas will be scrolling at one unit at a time. The next
  28. second, the canvas will be scrolling at ten units at a time, and
  29. so on.
  30.  
  31. 2. The slider seems to be very sensitive to the mouse movement.
  32. Therefore it is kind of hard to scroll to the desired position.
  33. (Things go by too fast. You can hardly tell what they are.)
  34. I would like to decrease the number of units of scrolling distance
  35. when the slider detects a mouse movement, (if that is a reasonable
  36. approach.)
  37.  
  38. 3. I would like to achieve the above as much in tcl script as
  39. possible.
  40.  
  41. I was planing on changing the scrollIncreament value every time
  42. a Button-Press event on the arrow is detected by using the 
  43. scrollIncreament option in canvas. However, this event seems to be
  44. detected only once, even though the arrow is still being pressed.
  45.  
  46. I took a look at tkScrollbar.c and found out most of the mouse events
  47. are handled in here, which somehow implies I might have to modify
  48. the code to achieve what I want.
  49.  
  50. Questions:
  51.  
  52. 1. Is there a way that I can get the auto-repeat event in tk, such that
  53.    I know the arrow is still being pressed?
  54.    If so, how? (If I can detect this event, maybe I can write a procedure
  55.    to change the scrollIncrement value. Or is there a better approach?)
  56.  
  57. 2. Is there a way to change the scrolling distance of the slider?
  58.    If so, how?
  59.  
  60. This question may not apply to my problem, but I am very
  61. curious about the answer.
  62.  
  63. 3. When I do a configure on scrollIncrement, I saw two numbers in the
  64.    output. One of them is the scrollIncrement distance. What about
  65.    the other one? Is it adjustable through configure also?
  66.  
  67. This would be a suggestion for tk3.0.
  68.  
  69. 4. Wouldn't it be nice to have the scroll bar mouse events been
  70.    bound the way other widgets do, i.e. using 'bind' command in tk?
  71.  
  72. Again, thanks for any input.
  73.  
  74. ---------------------------------------------------------------------------
  75. Te-Wei Sun
  76. tewei@bnr.ca
  77.