From: Luc Moulinier on 9 Feb 2010 05:43 Hello ! The "<text> get -displaychars" manual page says :"If the -displaychars option is given, then, within each range, only those characters which are not elided will be returned. ". Take the following script : set a [string repeat "[string repeat "0123456789" 10]\n" 10] pack [text .t -wrap none -width 10 -height 10] ..t insert end $a set lg [.t get -displaychars -- 1.0 1.50 2.0 2.50 3.0 3.50] puts "[string length [lindex $lg 0]]" returns 50. I would expect to have 10, as the width of the widget is 10, the 40 others characters being hidden. What do I miss here ? Note that the -wrap none is compulsory in my case. It wuld be really handfull to have an option (into the dump ot get command) to have the content of the visible part of the widget , .t get visible for example ... Thanks !! luc
From: Alexandre Ferrieux on 9 Feb 2010 05:59 On Feb 9, 11:43 am, Luc Moulinier <luc.moulin...(a)igbmc.fr> wrote: > Hello ! > > The "<text> get -displaychars" manual page says :"If the -displaychars > option is given, then, within each range, only those characters which > are not elided will be returned. ". > Take the following script : > > set a [string repeat "[string repeat "0123456789" 10]\n" 10] > pack [text .t -wrap none -width 10 -height 10] > .t insert end $a > > set lg [.t get -displaychars -- 1.0 1.50 2.0 2.50 3.0 3.50] > puts "[string length [lindex $lg 0]]" > > returns 50. I would expect to have 10, as the width of the widget is > 10, the 40 others characters being hidden. > > What do I miss here ? Note that the -wrap none is compulsory in my > case. > > It wuld be really handfull to have an option (into the dump ot get > command) to have the content of the visible part of the widget , .t > get visible for example ... "elided" means "having the -elide tag option", not "hidden by widget clipping". For the latter concern, use [xview], [yview], and [bbox]. -Alex
|
Pages: 1 Prev: How to read a number from a line? Next: command for last answer |