Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
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.

You can Add a comment or ranking to this page

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