Version 2 of Text widget improvements

Updated 2003-08-22 13:26:48

A page to collect ideas for improving Tk's text widget, and to list current limitations.

  • Foremost amongst these is the 'scrollbar problem' when there are wrapped lines of varying lengths. As you scroll, the length of the scrollbar changes!
  • Add a 'blockcursor' option to present a flashing block rather than thin line.
  • Add a method to count the number of characters between two index positions (currently the only way to do this is string length [.text get $idx1 $idx2])
  • Add helper code to implement a text replace operation which doesn't mess with the current insertion position or the current scroll position, unless such changes are actually required. (the naive use of delete followed by insert really isn't very satisfactory).
  • Add the ability to find the index at the beginning or end of any display line, whether that line is actually currently displayed or not.

Vince has placed a work-in-progress patch at http://sourceforge.net/tracker/?func=detail&aid=791292&group_id=12997&atid=312997 which addresses many of these issues.


My biggest (and only) frustration with the text widget is that it is too slow or weak. Loading really large files into it is very slow and painful. That renders apps like Tkdiff or Tkgrep practically useless.


Category suggestions