Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/text-area-and-adding-a-scrollbar-problem.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
text area and adding a scrollbar problem

Posted by acidburn123 (acidburn123), 29 April 2008
Hey guys,
I've a problem when it comes to adding a scrollbar to a text area.

the following code is meant to work:
Code:
set results [text $resultsBox.resuts1 -height 10 -width 80 -yscrollcommand "$resultsBox.ys set"]
set sb [scrollbar $resultsBox.ys -command "$resultsBox.resuts1"]

however I get the following error:
Quote:
bad option "scroll": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview
bad option "scroll": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview
   while executing
".x.queryResultsFrm.res.resuts1 scroll 1 units"
   ("uplevel" body line 1)
   invoked from within
"uplevel #0 $cmd scroll $amount units"
   (procedure "ScrollByUnits" line
   invoked from within
"ScrollByUnits $w hv 1"
   ("arrow2" arm line 1)
   invoked from within
"switch -- $element {
     "arrow1"      {ScrollByUnits $w hv -1}
     "trough1"      {ScrollByPages $w hv -1}
     "trough2"      {ScrollByPages $w hv 1}
     "arrow2"      {ScrollByUnit..."
   (procedure "ScrollSelect" line 4)
   invoked from within
"ScrollSelect $w $element initial"
   (procedure "tk::ScrollButtonDown" line 9)
   invoked from within
"tk::ScrollButtonDown .x.queryResultsFrm.res.ys 7 129"
   (command bound to event)



can anyone understand why? I thought you could associate a scrollbar with a text area

Posted by admin (Graham Ellis), 4 May 2008
Probably something to do with what's in your variables - I stripped it down to

text .results1 -height 10 -width 80 -yscrollcommand "gubbins set"
scrollbar .ys -command summat

which I sourced (and I added a pack too) and it set it up just fine - so I suspect that the problem lies in parts of the code / setup that you haven't shown us.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho