| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| S M Ryan schrieb: > I want to adjust the size of text widget so that all the text is vertically > visible for the current width, and no extra space. The information obviously > available or the text widget couldn't scroll. However it seems impossible to > prise it out of the 8.4 versions. > > It looks like the 8.5 has $t count -ypixels 1.0 end, but does that actually > count the entire vertical span, including scrolled off sections? Would this size > $t to fit exactly > > canvas $c ... > text $t ... > ... > $c create window -window $t -tags kumquat ... > ... > $c itemconfigure kumquat -height [ > $t count -ypixels 1.0 end > ] The width of Text can be measured without a window, what you need is a font object! font create meta -family helvetica -size 11 font measure meta Test --> gives the width of "Test" in pixel You have to calculate the height by hand! height:= lines * [tk scaling]* <font size> Or: In case of a canvas use bbox. ..c bbox my_textitem --> left top right bottom -roger |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.