home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!garfield
- From: garfield@cs.tu-berlin.de (Sven Delmas)
- Subject: Re: tkText help?
- In-Reply-To: gaede@bearsan.sda.COM's message of 22 Jul 92 21:23:29 GMT
- Message-ID: <GARFIELD.92Jul23134219@avalanche.cs.tu-berlin.de>
- Sender: news@mailgzrz.tu-berlin.de (News Manager)
- Nntp-Posting-Host: avalanche.cs.tu-berlin.de
- Organization: Techn. Univ. Berlin (Germany)
- References: <3696@bearsan.sda.COM>
- Date: Thu, 23 Jul 1992 12:42:18 GMT
- Lines: 50
-
- Hi,
-
- > I've installed the tkText widget 2.0 in TK 2.1. I'm using xf to
- > configure a GUI with text editing widget and scrollbars. I source the
- > code that xf generates, and then do the work I want to do to
- > fill the text widget, etc.
- >
- > I populate the widget by doing an insert at 0 with the contents of a file.
- > (This particular file has 7 lines). When I do so, the text widget executes
- > its "yscrollcommand" with invalid arguments (note that lastUnit is greater
- > than firstUnit):
- >
- > illegal lastUnit 6
- > while executing
- > ".frame.scrollbar1 set 7 0 7 6"
- >
- > I get this error message only once, and after that scrolling works just
- > fine.
- >
- > Any ideas for why this is happening, and how to fix it?
- What I currently do is just a work around. I call the scrollcommand
- not directly. Instead I call this little procedure:
-
- # Arguments: xfW - the widget
- # xfCmd - the set command
- # xfA-D - the parameters
- proc XFSmlScrollSet {xfW xfCmd xfA xfB xfC xfD} {
- if {$xfC < $xfD} {
- $xfW $xfCmd $xfA $xfB $xfC $xfD
- } {
- $xfW $xfCmd $xfA $xfB $xfD $xfC
- }
- }
-
- The scrollcommand look this way:
-
- -yscrollcommand "XFSmlScrollSet $xfW.$xfName.vscroll set"
-
- This doues not solve the problem, but you get rid of this error
- message. The error only occurs if the scrollbar is not needed (the
- text has fewer lines than the text widget can display).
-
- Greeting, Sven Delmas
- --
- ----
- Sven Delmas (Techn. Univ. Berlin)
- garfield@cs.tu-berlin.de
- ----
- For every problem there is a solution which is simple, clean and wrong.
- Henry Louis Mencken
-