Skip to content
Prev 15303 / 63421 Next

Getting width of Tk text widget via tcltk

"John Fox" <jfox@mcmaster.ca> writes:
Interesting...
<Tcl> 488
+      - 2*as.numeric(tkcget(textWindow, borderwidth=NULL)) - 4) /
+   as.numeric(tkfont.measure(tkcget(textWindow, font=NULL), "0"))
[1] 80
+       - 2*as.numeric(tkcget(textWindow, borderwidth=NULL)) - 2) /
+       as.numeric(tkfont.measure(tkcget(textWindow, font=NULL), "0"))
[1] 80.33333

Notice, btw, that textWindow$ID  shouldnn't be necessary.