From: Vince D. <vi...@sa...> - 2003-09-12 13:45:27
|
After several useful pieces of feedback on tip115, I've made a few modifications and adjustments (in particular, including smooth scrolling in the tip). I would certainly appreciate any continued feedback on the new version of the tip. In particular, however, there is one area that probably ought to be resolved before the tip is ready for voting/final-implementation/full-testing etc. This is the issue of 'chars' vs 'indices'. Historically it seems there has been little distinction made between these two concepts. This is really only a problem in one area: .text get $idx "$idx +N chars" does not necessarily return N characters since what the above code actually means is to step forward N _index_positions_. If there are any embedded images or windows, then fewer than N characters will be returned. In itself this isn't a problem, except how does one count in terms of actual characters? The best I can think of, which already makes use of some features of tip155 is: set n $N while {[.text count -chars $idx "$idx + $n chars"] != $N} { incr n } (ok, this could be improved further, but the basic point is we need some sort of iteration to determine something which the widget could very, very easily tell us). What would be nice would be to have both '+N chars' and '+N indices', but this of course would break backwards compatibility. So, any suggestions? thanks! -- Vince <http://www.santafe.edu/~vince> |