home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / tcl / 1037 < prev    next >
Encoding:
Text File  |  1992-07-23  |  2.1 KB  |  64 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!garfield
  3. From: garfield@cs.tu-berlin.de (Sven Delmas)
  4. Subject: Re: tkText help?
  5. In-Reply-To: gaede@bearsan.sda.COM's message of 22 Jul 92 21:23:29 GMT
  6. Message-ID: <GARFIELD.92Jul23134219@avalanche.cs.tu-berlin.de>
  7. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  8. Nntp-Posting-Host: avalanche.cs.tu-berlin.de
  9. Organization: Techn. Univ. Berlin (Germany)
  10. References: <3696@bearsan.sda.COM>
  11. Date: Thu, 23 Jul 1992 12:42:18 GMT
  12. Lines: 50
  13.  
  14. Hi,
  15.  
  16. > I've installed the tkText widget 2.0 in TK 2.1. I'm using xf to 
  17. > configure a GUI with text editing widget and scrollbars.  I source the
  18. > code that xf generates, and then do the work I want to do to
  19. > fill the text widget, etc.
  20. >
  21. > I populate the widget by doing an insert at 0 with the contents of a file.
  22. > (This particular file has 7 lines). When I do so, the text widget executes 
  23. > its "yscrollcommand" with invalid arguments (note that lastUnit is greater 
  24. > than firstUnit):
  25. >    illegal lastUnit 6
  26. >    while executing
  27. >    ".frame.scrollbar1 set 7 0 7 6"
  28. > I get this error message only once, and after that scrolling works just
  29. > fine.
  30. > Any ideas for why this is happening, and how to fix it?
  31. What I currently do is just a work around. I call the scrollcommand
  32. not directly. Instead I call this little procedure:
  33.  
  34. # Arguments: xfW - the widget
  35. #            xfCmd - the set command
  36. #            xfA-D - the parameters
  37. proc XFSmlScrollSet {xfW xfCmd xfA xfB xfC xfD} {
  38.   if {$xfC < $xfD} {
  39.     $xfW $xfCmd $xfA $xfB $xfC $xfD
  40.   } {
  41.     $xfW $xfCmd $xfA $xfB $xfD $xfC
  42.   }
  43. }
  44.  
  45. The scrollcommand look this way:
  46.  
  47. -yscrollcommand "XFSmlScrollSet $xfW.$xfName.vscroll set"
  48.  
  49. This doues not solve the problem, but you get rid of this error
  50. message. The error only occurs if the scrollbar is not needed (the
  51. text has fewer lines than the text widget can display).
  52.  
  53. Greeting, Sven Delmas
  54. --
  55. ----
  56.   Sven Delmas (Techn. Univ. Berlin)
  57.     garfield@cs.tu-berlin.de
  58. ----
  59.   For every problem there is a solution which is simple, clean and wrong.
  60.                                                   Henry Louis Mencken
  61.